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.
How difficult would it be to extend OG Access functionality to include non node based entities? For example, a custom entity-type that is both a Group and Group Content, that can optionally be set as a Private Group and/or as Private Group Content?
Comments
Comment #1
minorOffense CreditAttribution: minorOffense commentedTucked away inside of OG is a function called og_user_access_entity() which you can use as part of your access callback on your custom entity types.
There's also og_user_access() and hook_og_permission() which would let you check and define the permissions required to perform whatever action against your entity.
I'm working on a custom module to do just that. I'll post some sample code here when I'm done. I don't know if there's a way to generically write an access layer for any entity (not until D8 anyways). You'd have to repeat the pattern for any custom entity you create.