Problem/Motivation
When Group Permissions is enabled, outsider advanced permissions coming from the module Group are not considered.
Steps to reproduce
- Create a Drupal global role
- In a group type, assign advanced outsider permission to this role (for example allow it to edit the group)
- Without Group Permissions enabled, log in as a user with this role and see you can access to group edition page
- Enable Group Permissions and see that you can't anymore accede to the group edition page.
The problem comes from the parameter $overwrite of the merge method calculated permission object.
When Group Permissions is disabled, calculators are called in the following order by the Group module :
- SynchronizedGroupPermissionsCalculator (containing advanced outsider permissions)
- DefaultGroupPermissionsCalculator
And the $overwrite parameter is set to FALSE so the default group permissions will not cancel the advanced outsider permission.
When Group Permissions is enabled, calculators are called in the following order by this module :
- SynchronizedGroupPermissionsCalculator (containing advanced outsider permissions)
- DefaultGroupPermissionsCalculator
- GroupPermissionCalculator (override coming from this module)
And the $overwrite parameter is set to TRUE so the default group permissions at step 2 will cancel the advanced outsider permission.
Proposed resolution
I understand that $overwrite parameter has to be set to TRUE to let Group Permissions override the default group type permissions but I think it should do it only for his own calculator.
So $overwrite $parameter should be set to FALSE while using SynchronizedGroupPermissionsCalculator and DefaultGroupPermissionsCalculator and it should be set to TRUE while using GroupPermissionCalculator.
Comment | File | Size | Author |
---|---|---|---|
#2 | 3270219-2.patch | 1000 bytes | Nixou |
Comments
Comment #2
Nixou CreditAttribution: Nixou at Actency commentedComment #3
Ivan616 CreditAttribution: Ivan616 at Websolutions Agency commentedI have encountered exactly the same issue on the project I work on.
Even tho permissions for the outsider were selected, "Update any group content entity" permission kept getting overwritten.
There was no way to give permission just to a single role in the outsider section if the permission in the basic permission form section was different.
It would overwrite it.
I have applied and tested the submitted patch and it worked for me.
Comment #5
LOBsTerr CreditAttribution: LOBsTerr at European Commission and European Union Institutions, Agencies and Bodies commentedThank you for your contribution