CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Limiting fields that users can see
Pages: [1]

Author Topic: Limiting fields that users can see  (Read 1055 times)

leupi

  • I post frequently
  • ***
  • Posts: 192
  • Karma: 2
Limiting fields that users can see
January 07, 2011, 08:07:30 am
I'm having a bit of trouble understanding how to best do this.

I have an Individual that I want many user groups to see (such as Anonomous, Authenticated, and others) but I do not want them to all see the same information. If you are in the user group 'Human Resources' then you should have the ability to see more personal information than an Anonomous user that only needs to see 'Name', 'Email', and 'Position'. We want to use CiviCRM to have our Employee list accessable on our website and that will nessecitate customizing views for a wide variety of users, some that work here, some that we do business with, and others that just want to contact one of our employees.

What is the best way to accomplish this?

leupi

  • I post frequently
  • ***
  • Posts: 192
  • Karma: 2
Re: Limiting fields that users can see
January 07, 2011, 09:40:33 am
An example of what I'm trying to do is at http://wiki.civicrm.org/confluence/display/CRMDOC33/Basic+Profile+Functions at the following part:
Quote
You can create a "Data Viewing" PROFILE that shows only the information you need when reviewing a client's record.
That profile could look like this:
I would like to create a view such as that and make it the only view that specific groups of users can use to see contacts. Other groups of users could use a view (profile) that give more detailed information.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Limiting fields that users can see
January 07, 2011, 02:09:45 pm
You can do some of this (but maybe not sufficient) using the Visibility setting on each profile field. Folks whose role doesn't include "view all contacts" won't be able to see fields that are marked "User and User Admin" (if my recollection is correct).

If that's not granular enough, check out using CiviCRM "native" ACLs to control access by Profile, and create different Profiles for different groups. Some info here and on the admin screens inline:

http://wiki.civicrm.org/confluence/display/CRMDOC33/Access+Control

Protect your investment in CiviCRM by  becoming a Member!

leupi

  • I post frequently
  • ***
  • Posts: 192
  • Karma: 2
Re: Limiting fields that users can see
January 12, 2011, 09:42:15 am
Am I going about this is the wrong way? What is the prefered way to do something like this? Say I have a contact, an employee, and I want that contact to be viewed by anyone that happens to see our 'Employee Directory' on our site. I only want an anonymous user to see Last Name. First Name, and Email address while someone that also happens to be in a group called 'Employees' can see Mobile Number, Home Address, etc., and someone else in a group called 'Development' can also see any donations that that person has made to our organization (we are a non-profit).

I would assume that this is a common need. Is there a preferred way to do this? If it is by using ACLs combined with profiles then I'll hunker down and figure it out. Just wondering if that is indeed the best course of action here.

Thanks.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Limiting fields that users can see
January 12, 2011, 11:52:23 am
Assuming you're using Drupal, and it's ok for "Employees" to see all stored contact info (address, name, phones, emails, etc.) - this should get u close w/o much hassle:

* Drupal > Administer > Users
- create 2 roles: Employees and Development Staff
- give Employees permissions for 'access CiviCRM', 'view all contacts'
- give Dev Staff those plus 'access CiviContribute' and any other contrib related perms ('edit contributions' for example)
- give Anonymous 'profile listings' and 'profile view' permission

* CiviCRM Admin > Customize > Profiles
- create Employee Directory profile with all the fields you want to include for anonymous folks, make Visibility = public for those fields

Now anonymous can use profile search, listings, view to see contacts in Employee Directory. Employees can use normal civicrm search and contact summary screens to see all contact info but NOT contributions. Dev folks can see that plus contribs.

Your needs may not be exactly above but this is a typical setup.
Protect your investment in CiviCRM by  becoming a Member!

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Limiting fields that users can see
January 12, 2011, 01:48:48 pm
If you are on Drupal you can also use Views which can then deliver different sets of data depending on the Drupal Role they have - and you can synch Drupal Roles with CiviCRM Groups - in case that helps.
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

leupi

  • I post frequently
  • ***
  • Posts: 192
  • Karma: 2
Re: Limiting fields that users can see
January 13, 2011, 08:16:30 am
Dave,

I did what you said but I'm having one problem (so far) and I'm sure that it is because I am missing something rather basic. I created the profiles and gave the permissions as you directed. Now when I access the site as an anonymous user I have no way to even do a search in CiviCRM for any contacts. Since an anonymous user does not have "access CiviCRM" permission how am I supposed to get there? Whenever I try to access anything in CiviCRM as an anonymous user I get the following:
Quote
Access denied
You are not authorized to access this page.

leupi

  • I post frequently
  • ***
  • Posts: 192
  • Karma: 2
Re: Limiting fields that users can see
January 13, 2011, 08:51:23 am
Peter,

I was poking around with views figuring that I would also give that I shot but when trying to create one I got this message in the preview:
Quote
user warning: Table 'natureserve.civicrm_contact' doesn't exist query: SELECT civicrm_contact.id AS id, civicrm_contact.last_name AS civicrm_contact_last_name FROM civicrm_contact civicrm_contact LIMIT 0, 10 in /var/www/natureserve/sites/all/modules/views/includes/view.inc on line 771.
Any thoughts what that might be about?
« Last Edit: January 13, 2011, 09:15:58 am by leupi »

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Limiting fields that users can see
January 13, 2011, 09:26:13 am
Profiles have their own built-in search interface. If you haven't browsed the wiki and book sections, will help:
http://wiki.civicrm.org/confluence/display/CRMDOC33/Linking+Profiles

http://en.flossmanuals.net/CiviCRM/CapturingExposing
Protect your investment in CiviCRM by  becoming a Member!

leupi

  • I post frequently
  • ***
  • Posts: 192
  • Karma: 2
Re: Limiting fields that users can see
January 14, 2011, 06:24:22 am
Can't tell you how much help this thread has been for me. I'm finally seeing good results  :)

I am having one very strange problem though. I have two profiles that have the same fields but target different groups of contacts. It seems that I can now only access one profile. If I access profile ID=18 then that is the only one that I can access until I log out then log back in. Then I can access profile ID=17, but again that is the only one that I can access till I log out and then in again. The profiles are working just as I wanted except for this issue.

Any thoughts on this one?

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Limiting fields that users can see

This forum was archived on 2017-11-26.