Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Related to #1961296: Refactor og_group_ref field per OG API improvements.
Fire an hook when og_role_grant_permissions or og_role_revoke_permissions are altering role permissions.
A patch is on the way.
Comment | File | Size | Author |
---|---|---|---|
#9 | hook_on_permissions_change-1975844-9.patch | 2.99 KB | itamar |
#7 | hook_on_permissions_change-1975844-7.patch | 1.83 KB | itamar |
#5 | hook_on_permissions_change-1975844-5.patch | 2.02 KB | itamar |
#3 | hook_on_permissions_change-1975844-3.patch | 1.64 KB | itamar |
#1 | hook_on_permissions_change-1975844-1.patch | 763 bytes | itamar |
Comments
Comment #1
itamar CreditAttribution: itamar commentedPatch fire two hooks, from og_role_grant_permissions() and og_role_revoke_permissions().
Comment #2
amitaibuPlease add relevant docs in og.api.php
Comment #3
itamar CreditAttribution: itamar commentedAdding the hooks documentation.
Comment #4
amitaibuLast nitpick, we usually add (even if it's a little silly) an example, illustrating the user.
e.g.
Comment #5
itamar CreditAttribution: itamar commentedAdding sample usage to the documentation.
Comment #6
amitaibuCommitted, thanks.
Comment #7
itamar CreditAttribution: itamar commentedAs discussed, in order to avoid issues arising from firing the granted hook before permissions have been revoked, it probably makes more sense to unify these two hooks under one hook called from og_role_change_permissions().
Comment #8
amitaibuCan you re-roll this patch against the latest dev (i.e. remove the old wrong hook)
Comment #9
itamar CreditAttribution: itamar commentedRe-rolling #7.
Comment #10
amitaibuCommitted, thanks.