og icon indicating copy to clipboard operation
og copied to clipboard

Possibility to "override" group roles and permissions in the D8 version

Open pfrenssen opened this issue 7 years ago • 2 comments

In Drupal 7 we had the possibility to "override" roles and permissions on a per-group basis. Here is a screencast that introduces the concept: D7 Organic Groups pt 11 - Override Roles & Permissions.

To get access this functionality the 'OG access control' submodule needed to be enabled and this unlocked configuration forms to manage roles and permissions for individual groups.

This resulted in a lot of added complexity in the D7 code base, see for example og_roles(). Some of it has crept into D8 already (OgRole::setGroupId() and OgRole::getGroupId()) but this is not used anywhere at the moment.

We need to decide first if we want to keep this functionality in D8. To me it sounds like an edge case, and one that can also be trivially solved by creating a separate group type for the group(s) that require custom roles and permissions. A well-architected website should not have a lot of divergence in roles and permissions across different group types.

If we do decide to keep this functionality (e.g. because a large number of the D7 user base are making use of this feature) then we need to figure out how to implement this. I would like to keep the added complexity to a minimum, so maybe a good approach would be to create an additional config entity type OverriddenOgRole which extends OgRole. It can have its own handling of the role ID etc, but for the rest it can inherits almost everything from OgRole.

pfrenssen avatar May 02 '17 13:05 pfrenssen

The feature should stay (in DrupalCon conversation several people confirmed they were using it to give different permissions to different roles).

I have an idea on how to allow a scalable solution via having OgRole ( as ConfigEntity) and OgRoleContent (as ContentEntity), and have OgMembership two ER properties -- one to reference the config and another to the overridden content.

Lets discuss this before we start coding ;)

amitaibu avatar May 02 '17 16:05 amitaibu

Is there any practical way to get movement on this if we are unable to do the work ourselves? (Not yet, anyway.) I work with several sites that rely on this feature, and which will not be able to move to Drupal 8 without it.

bradbulger avatar Jan 09 '20 16:01 bradbulger