Problem/Motivation

When Group Permissions is enabled, outsider advanced permissions coming from the module Group are not considered.

Steps to reproduce

  1. Create a Drupal global role
  2. In a group type, assign advanced outsider permission to this role (for example allow it to edit the group)
  3. Without Group Permissions enabled, log in as a user with this role and see you can access to group edition page
  4. 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 :

  1. SynchronizedGroupPermissionsCalculator (containing advanced outsider permissions)
  2. 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 :

  1. SynchronizedGroupPermissionsCalculator (containing advanced outsider permissions)
  2. DefaultGroupPermissionsCalculator
  3. 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.

CommentFileSizeAuthor
#2 3270219-2.patch1000 bytesNixou
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Nixou created an issue. See original summary.

Nixou’s picture

Status: Active » Needs review
FileSize
1000 bytes
Ivan616’s picture

Status: Needs review » Reviewed & tested by the community

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

  • LOBsTerr committed 7bdc8f5 on 1.0.x authored by Nixou
    Issue #3270219 by Nixou: Outsider advanced permissions lost
    
LOBsTerr’s picture

Status: Reviewed & tested by the community » Fixed

Thank you for your contribution

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.