0

How are global roles synced with group roles in the Drupal 8 group module?

I expect that the module would either:

  • Create a group roles in each group type for each global role

and/or one of the below:

  • Create role assignments for users in the group who have a global role that matches a group role name.
  • Assign global roles for users who have a group role in any group where the group role name matches a global role name.

In my testing so far it appears to do none of the above.

The group role sub-module is marked as deprecated and has a note that the functionality is in the core group module. A code review shows that the sub-module is basically empty. Therefore I take it the note is correct. I also see that the group module implements hook_rebuild and it creates a config entity for each global role.

None of the above expected results are happening however.

1

Take a look at the roles & permissions page for a group (and also group's documentation). By default groups treats all authenticated non-members as outsiders no matter what their role is, but there is an advanced option to define permissions based on their global drupal roles.

0

The answer turns out to be that the word "sync" is a bit misleading in the context of what group roles does. "Sync" implies some kind or periodic or event based update. There is no periodic change or update to the group or global roles of any user based on their roles at the other level.

The group role feature only allows "Advanced Outsider Permissions" which allows those with global roles to have a certain role in every group of a certain group type. Thanks to @sonfd for mentioning it. I had located this feature as well but didn't recognise it as "sync".

This effectively provides for what I had asked for when I said "Create role assignments for users in the group who have a global role that matches a group role name.". Although it does not provide role assignments it does provide permission assignments.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.