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

minorOffense’s picture

Issue summary: View changes

Tucked 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.