Calculator returns roles other than individual

Created on 4 April 2023, about 1 year ago
Updated 29 April 2024, about 2 months ago

Problem/Motivation

I'm getting an error I didn't see when I last used this method a month ago. I assigned outsider to the admin role for the groups module that requires this module.

Now I receive this error and I'm looking for guidance on how to resolve this due to it white screening any page I'm signed into.

Drupal\flexible_permissions\CalculatedPermissionsScopeException: The calculator "Drupal\group\Access\IndividualGroupPermissionCalculator" returned permissions for scopes other than "individual". in Drupal\flexible_permissions\ChainPermissionCalculator->calculatePermissions() (line 145 of modules/contrib/flexible_permissions/src/ChainPermissionCalculator.php).

Steps to reproduce

Have existing groups, Make an outsider role with admin permissions, Get error.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ’¬ Support request
Status

Closed: works as designed

Version

1.0

Component

User interface

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Chompp
  • Sorry I figured it out by making a new role rather than assigning it to an existing one. I still attached it to the admin role for anyone else who experiences this same error.

    I'm a clown, I'll leave this open for you to close at your leisure. I'm unsure of the preferred method for a question that isn't a question anymore.

  • Status changed to Closed: works as designed about 1 year ago
  • πŸ‡§πŸ‡ͺBelgium kristiaanvandeneynde Antwerp, Belgium

    This is what "Works as designed" is for.

  • Status changed to Active about 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States ultimike Florida, USA

    I'm not sure this "works as designed". I am getting the same error in a pretty simple scenario and I'm not sure what @Chompp means by "I figured it out by making a new role rather than assigning it to an existing one."

    I have a mostly fresh D10 site with Group 3.1.0 and Flexible Permissions 1.0.0.

    I have a Drupal role that maps to a Group type role with Scope=Outsider and the "Admin role" checkbox unchecked on the group role Edit page.

    The only Drupal permissions I have given the corresponding Drupal role are "Use the toolbar", "Access the Content overview page", and to create nodes of a single content type.

    When I login with a user who has the role, and try to access admin/content, I get the same error mentioned above. The only way I can avoid the error is by setting the Group role's "Scope" to "insider".

    -mike

  • Status changed to Closed: works as designed 12 months ago
  • πŸ‡§πŸ‡ͺBelgium kristiaanvandeneynde Antwerp, Belgium

    I noticed you got help on Slack, please reopen if the issue persists. But it seems like there was some confusion about insider vs outsider. Please also take some time to watch the video series that were launched alongside Group v2/3, they contain a lot of useful info on the new features.

  • πŸ‡¨πŸ‡¦Canada bbombachini London, ON

    If you're here and have no idea where to find the video series he's talking about, here it goes: https://www.youtube.com/playlist?list=PLWsDPX910IWxhowXYlXDrSG_A5H7_shv5

  • πŸ‡ΊπŸ‡ΈUnited States Will Kirchheimer New Orleans

    Having same problem, I'll check the videos, but can we post the solution within the issue queue, or even a link to the slack?

    (This problem for us is immergent in the middle of or d10 upgrade, where we didn't have it in there last week)

  • πŸ‡§πŸ‡ͺBelgium kristiaanvandeneynde Antwerp, Belgium

    Also make sure you do not try to assign an insider or outsider role to a membership via code.

  • πŸ‡©πŸ‡ͺGermany tim909

    I'm getting the exact same behaviour as mentioned above. Have watched the videos but obviously the creator of the video does not run into this bug. I'm not assigning anything by code, just created a role as outsider according to the video instructions and the error pops up. Not sure hat to do next.
    It would be beneficial if there's a solution out there (e.g. on slack) to post it back here.

  • πŸ‡ΊπŸ‡ΈUnited States electrokate

    Deleting and re-creating the group admin role fixed this error for me.

  • πŸ‡ΊπŸ‡ΈUnited States mabdullah91

    we are facing the same issue, we didn't assign any role by code. it's simply an issue if we have an outside role assigned to more than 1 Drupal role. It throws an error message:

    Drupal\flexible_permissions\CalculatedPermissionsScopeException: The calculator "Drupal\group\Access\IndividualGroupPermissionCalculator" returned permissions for scopes other than "individual". in Drupal\flexible_permissions\ChainPermissionCalculator->calculatePermissions() (line 145 of /code/web/modules/contrib/flexible_permissions/src/ChainPermissionCalculator.php).

    The workaround I can think of is to write a script to make people members of all the groups so they can see the groups even when they are not administrator.

  • πŸ‡§πŸ‡ͺBelgium kristiaanvandeneynde Antwerp, Belgium

    Please open a new issue with steps to reproduce on a clean install. This issue has been closed 8 months ago.

    if we have an outside role assigned to more than 1 Drupal role

    Did you do this through code because that's unintended and the UI doesn't allow that.

    The workaround I can think of is to write a script to make people members of all the groups so they can see the groups even when they are not administrator.

    That would completely kill your site's performance

  • πŸ‡ͺπŸ‡ΈSpain abelass

    For me deleting and recreating the role did the trick

Production build 0.69.0 2024