christianwach / civicrm-wp-member-sync

CiviCRM WordPress Member Sync plugin keeps a WordPress user in sync with a CiviCRM membership by granting either a role or capabilities to a WordPress user who has that membership.
https://wordpress.org/plugins/civicrm-wp-member-sync/
GNU General Public License v2.0
17 stars 10 forks source link

Feature Request: Add User to Multiple Roles Based on CiviCRM Group Membership #17

Closed mikejr83 closed 7 years ago

mikejr83 commented 7 years ago

Requirement

By defining a mapping, either through a UI construct or through a hook, the plugin should enable the mapping from a group within CiviCRM to a role or capability in WordPress.

Use Case / User Story

In this scenario image an organization where the election of officers occurs on some annual basis. After the elections are completed an administrator logs into the system, removes any contacts/individuals which are no longer officers, adds any contacts/individuals which are now officers, and then performs a sync.

Once a sync is triggered the plugin should apply the mapping in a many-to-one fashion instead of the current a one-to-one mapping.

Other Info

Ideally I would like some slick UI to handle group to role/capability mapping however some hook to do this would also be neat.

christianwach commented 7 years ago

@mikejr83 I implement group <=> capability mapping by using BP Groups CiviCRM Sync and a couple of callbacks that apply capabilities when group membership changes. Indeed in many cases, BuddyPress group membership can behave exactly like capabilities. IIRC, wordpress.org used this (and perhaps still does) instead of built-in capabilities. BuddyPress would then provide your slick UI ;-)