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 »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • ACL/permissions and Drupal Roles
Pages: [1]

Author Topic: ACL/permissions and Drupal Roles  (Read 1611 times)

ehanuise

  • I post occasionally
  • **
  • Posts: 85
  • Karma: 2
  • CiviCRM version: 4.1.3
  • CMS version: Drupal 7.17
  • MySQL version: 5.1.49-3
  • PHP version: 5.3.3-7+squeeze3
ACL/permissions and Drupal Roles
June 07, 2012, 07:25:45 am
Hi.
I've been asked to push forward with our evaluation of civicrm, and the next step is the management of permissions.
I've set up a drupal 7 + civicrm instance.

Staff will access civicrm using their active directory login (via the drupal LDAP authentication module). no-one else will access the system, i.e. the contacts do not have access to civicrm, only the staff.

In Drupal, we've set  pair of roles for the staff : 'staff' which is just about everyone, and 'management' who is just the management team.

I'm requested to set up permissions in civicrm so that management can have some contacts that 'staff' cannot access/modify/export/...

I read carefully the acls, groups and permissions info. The process is :
- remove civicrm permissions in Drupal
- create a civicrm access group
- add people to the access group
- create a civicrm ACL and define permissions for the ACL
- link group and ACL

this works well, but it is static : if a new user joins or leaves the staff, this info is updated in the AD/LDAP (user is added/removed to the drupal 'staff' role) but civicrm stays impervious to this.

So How do I link a civicrm acl to a drupal role instead of a civicrm access group, hor how do I create a civicrm access group that stays in sync with a given Drupal role ? Is this supported ? Is there a module to do it ? Is this not a common use-case ? have I missed something Obvious ?

Thanks in avdance.

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: ACL/permissions and Drupal Roles
June 07, 2012, 10:49:38 am
Wow, interesting!  I hadn't considered this approach before, but it makes a lot of sense.

I think the best way to handle your situation is with the Rules module, as well as CiviCRM Rules integration.  Create a new rule "After updating an existing user account", with element "User has role(s): staff", and an action "Add Contact to CiviCRM group".  And of course, create a complementary rule for removing a contact from a group.

Post back and let us know if this solves your problem!
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: ACL/permissions and Drupal Roles
June 07, 2012, 02:52:50 pm
Wondering if you could use the civicrm_group_roles module which ships w/ CiviCRM. This does 2-way synch between a Drupal role and a CiviCRM group.
Protect your investment in CiviCRM by  becoming a Member!

ehanuise

  • I post occasionally
  • **
  • Posts: 85
  • Karma: 2
  • CiviCRM version: 4.1.3
  • CMS version: Drupal 7.17
  • MySQL version: 5.1.49-3
  • PHP version: 5.3.3-7+squeeze3
Re: ACL/permissions and Drupal Roles
June 11, 2012, 05:17:16 am
Quote from: Dave Greenberg on June 07, 2012, 02:52:50 pm
Wondering if you could use the civicrm_group_roles module which ships w/ CiviCRM. This does 2-way synch between a Drupal role and a CiviCRM group.

2 way ?  the documentation seemed to imply it was civicrm => drupal only  :-[
I'll check that one out, thanks for the pointer!

ehanuise

  • I post occasionally
  • **
  • Posts: 85
  • Karma: 2
  • CiviCRM version: 4.1.3
  • CMS version: Drupal 7.17
  • MySQL version: 5.1.49-3
  • PHP version: 5.3.3-7+squeeze3
Re: ACL/permissions and Drupal Roles
June 20, 2012, 05:01:55 am
I added the roles sync, but it apparently does nothing, no groups are added to the users.
We have ldap auth enabled, so users don't have drupal accounts proper, we use the ldap for that.
We have users in ldap (AD in fact), with groups.
The LDAP module allows these users to auth in Drupal (works fine) and create and assigns drupal roles to them (works fine too)
Then group sync should add to the user's contact page in civicrm a civicrm group based on the user's drupal role (I created an association rule for that our_drupal_role <=> target_civicrm_group. However, this doesn't happen.
And when I check the user's contact page in civicrm, it does link to the userid of that user in drupal, so that part does work.

I have a bad feeling that some triggers that get triggered when you actually create a drupal user account aren't when you use ldap. Still, it doesn't work and I don't know where to look at to trace the whole process of use. Any pointers welcome :)

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: ACL/permissions and Drupal Roles
June 20, 2012, 09:06:18 am
It sounds like you're having the same problem described by these folks:
http://groups.drupal.org/node/23486
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

ehanuise

  • I post occasionally
  • **
  • Posts: 85
  • Karma: 2
  • CiviCRM version: 4.1.3
  • CMS version: Drupal 7.17
  • MySQL version: 5.1.49-3
  • PHP version: 5.3.3-7+squeeze3
Re: ACL/permissions and Drupal Roles
June 21, 2012, 02:04:13 am
Quote from: JonGold on June 20, 2012, 09:06:18 am
It sounds like you're having the same problem described by these folks:
http://groups.drupal.org/node/23486
Unfortunately there's precious little info in their post, and no mention of a solution  :'(

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • ACL/permissions and Drupal Roles

This forum was archived on 2017-11-26.