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 Drupal Modules (Moderator: Donald Lobo) »
  • Civigroup sync role - remove user from group when role is removed on drupal
Pages: [1]

Author Topic: Civigroup sync role - remove user from group when role is removed on drupal  (Read 1155 times)

Franco

  • I’m new here
  • *
  • Posts: 10
  • Karma: 0
  • CiviCRM version: 4.4
  • CMS version: Drupal 6
  • MySQL version: 5.6.12
  • PHP version: 5.4.16
Civigroup sync role - remove user from group when role is removed on drupal
October 24, 2013, 02:08:13 pm
Currently using civicrm 4.3.7 on drupal 6

Our big question is what is the point of paid membership registrations. So if a user pays in civicrm under membership registrations then they get their status to change to 'Member'. We want all those who paid for this membership to be able to see certain memberonly events. otherwise what is the purpose of paid membership registration.

From what we have read this can be done with roles. so using CiviMember Sync module we were able to get civicrm 'Members' to have a special role in drupal, called 'drupal_Member'. but even now we can't make people who paid have access to certain events.

Then we tried groups, using CiviGroup sync role module where if someones already a 'Member' in drupal they get added into a certain group with ACL's. but we couldn't make it work the other way. so if the membership expires in civicrm, it removes the role in drupal but it doesn't remove them from their group.

Is there no way to sync all membertypes to a certain group automatically?

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Civigroup sync role - remove user from group when role is removed on drupal
October 24, 2013, 02:23:42 pm
Why not use a smart group?
Try asking your question on the new CiviCRM help site.

Franco

  • I’m new here
  • *
  • Posts: 10
  • Karma: 0
  • CiviCRM version: 4.4
  • CMS version: Drupal 6
  • MySQL version: 5.6.12
  • PHP version: 5.4.16
Re: Civigroup sync role - remove user from group when role is removed on drupal
October 25, 2013, 07:47:27 am
The smart group feature does not have the ACL feature in the group type, so how do we restrict/allow members from/to certain events?

So for instance what if the user just purchased a membership and is signing up for an event for the first time. How would only they be able to access a certain event and not just any user?
« Last Edit: October 25, 2013, 08:20:29 am by Franco »

kreynen

  • I post occasionally
  • **
  • Posts: 105
  • Karma: 8
Re: Civigroup sync role - remove user from group when role is removed on drupal
October 25, 2013, 09:34:21 am
@Coleman Watts can smart groups now be used with CiviCRM Group Role Sync?  That hasn't been an option in the past.

Quote
Is there no way to sync all membertypes to a certain group automatically?

@Franco - There is, but you don't need to synchronize the group or membership to a Drupal role unless you are going to use Drupal's role based permissions to control who can do what.  For example if you were going to limit all access to 'CiviMail: view public CiviMail content'  to only active members or create nodes of the blog content type, you could accomplish that with CiviCRM Member Role Sync. 

Another example of where you'd use is to manage event registration with Webforms and control who can access the Webforms by Drupal role... but is there even a way to limit registration to a specific group or membership with just CiviCRM?

The only permissions you have to work with on the Drupal side are  'CiviEvent: view event info' and 'CiviEvent: register for events'.
   
https://drupal.org/project/civicrm_multiday_event provides something of a work around because you can use node level access controls to limit access to specific event nodes to specific roles, block all non-admin users from accessing the CiviEvent directly, but still 'CiviEvent: register for events'.  This is a bit of a hack because if user got the direct link to the registration form, they'd be able to register even though they couldn't access the civicrm_multiday_event node.

I think some of the confusion about the synchronization modules might be about when the synchronization happens.

Both CiviCRM Member Role Sync and CiviCRM Group Role Sync modules have "Manually Synchronize" options.  They also include a hook to update the user's roles when the user logs in and on cron. 

https://github.com/civicrm/civicrm-drupal/blob/7.x-master/modules/civicrm_member_roles/civicrm_member_roles.module#L112

https://github.com/civicrm/civicrm-drupal/blob/7.x-master/modules/civicrm_member_roles/civicrm_member_roles.module#L89

I don't believe there is anything in the modules to update the user's role immediately after a change to their membership status.  https://drupal.org/project/civicrm_certify does this using the hook_civicrm_post()...

http://drupalcode.org/project/civicrm_certify.git/blob/refs/heads/7.x-2.x:/civicrm_certify.module#l757

... but I don't see anything like that in the CiviCRM Member Role Sync and CiviCRM Group Role Sync modules. 

I know the cron function works when everything is configured correctly because we have users complain that it is working too well.  They will manually add a user to member role in Drupal, only to check an hour later and see the user is no longer in the role.  That's because when cron ran, Drupal checked with CiviCRM and saw that the user was no longer qualified to be in the role based on the rule and removed the user from the role.

There are a number of ways to accomplish member only events w/ CiviCRM, but that's really an different issues from getting the CiviCRM Member or Group Synchronization issues.




Franco

  • I’m new here
  • *
  • Posts: 10
  • Karma: 0
  • CiviCRM version: 4.4
  • CMS version: Drupal 6
  • MySQL version: 5.6.12
  • PHP version: 5.4.16
Re: Civigroup sync role - remove user from group when role is removed on drupal
October 25, 2013, 11:59:49 am
Quote
is there even a way to limit registration to a specific group or membership with just CiviCRM?

There is a way in civicrm by using ACL (Access control list) which can restrict specific contact groups to events.
http://wiki.civicrm.org/confluence/display/CRMDOC/Access+Control+Context+and+Overview

Quote
https://drupal.org/project/civicrm_multiday_event provides something of a work around because you can use node level access controls to limit access to specific event nodes to specific roles, block all non-admin users from accessing the CiviEvent directly, but still 'CiviEvent: register for events'.

The civicrm_multiday_event module, like you said is a hack and isn't something we can use for security reasons.

I also read up on the readme.txt on the civicrm_group_roles module and realized that "Role does NOT remove the user from the CiviCRM group".
So my question now is there a work around for this?

Note: I've searched around and found this http://issues.civicrm.org/jira/browse/CRM-6246, just wondering what has happened.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Civigroup sync role - remove user from group when role is removed on drupal

This forum was archived on 2017-11-26.