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

Grant capability to WpUser it's synced if CiviContact has registered as an event participant (of certain role/statute) #37

Closed jbonlinea closed 2 years ago

jbonlinea commented 3 years ago

Hi

This may be slightly out of this specific module scop, and could also find it's place in civi-event-organiser plug-in, but either way the "need" is the same. This module is a awesome way to restrict access to content based on Civi membership statut.

In the same vein, one may organize an event and restric access to some of it's site content to the ones that have registered. At the moment, i don't think we can add a capability to a wp user based on his event registration role or statute. Thus I can only think of creating a new membership type in Civi that you grant when one register to an event, it could work, but

So here we are, I wonder if you ever have thought of that, fell that need or a similar one, if/how you address it, or if it actually is a missing feature of Civi/WP integration that could be (must be ?) addresse throught this or civi-event-organiser plug-in ?

Cheers

christianwach commented 3 years ago

At the moment, i don't think we can add a capability to a wp user based on his event registration role or status.

@jbonlinea I think you're right that this functionality isn't available "out of the box". I'm sure it can be done using the hooks in CEO and/or CiviCRM, but haven't had the need for it so haven't looked closely at this issue. You might be able to do something with CiviRules in the meantime.

jbonlinea commented 3 years ago

Hi thank's for your reply

actually I've wonder fe times if/where I could find the list of available filters and hook for this plug-in (and all your civi related ones) ;

yes CiviRule could work, but I just bumped into a use case where event registration is suppose to giver user access to some part of the site content, and I think this might not be isolated due to the covid and off-site participation growth ;)

Cheers

christianwach commented 3 years ago

the list of available filters and hook for this plug-in

@jbonlinea Just search the code for "apply_filters" and "do_action" :-)

christianwach commented 3 years ago

event registration is suppose to giver user access to some part of the site content

How about this:

Seems like it should work.

jbonlinea commented 2 years ago

Hi there :)

This is about what I have done the first time I needed this feature but there were few limitations I can't remember at the moment, and civirules (still) do not play well with civicrm-wp-profile sync, I had open an issue on your plug-in repo, as well as on the CiviRules repo

Thank's for the suggestion

Cheers

christianwach commented 2 years ago

@jbonlinea I left a bug report on the CiviRules issue.