Make it possible to alter calculated permissions

Created on 9 November 2022, almost 2 years ago
Updated 23 March 2023, over 1 year ago

Problem/Motivation

Flexible permissions building permissions based on discovered calculated permissions from provided in the system calculators.
And once permission provided by some of calculators I can't cancel it out, because we merge all permissions.

ChainPermissionCalculator.php

      $calculated_permissions = new RefinableCalculatedPermissions();
      foreach ($this->getCalculators() as $calculator) {
        $calculated_permissions = $calculated_permissions->merge($calculator->calculatePermissions($account, $scope));
      }

Even RefinableCalculatedPermissions class supports overriding in addItem method, but it is never used.

Currently, for group permissions module I have to decorate ChainPermissionCalculator in order to override permissions.

Let's just imagine the case, when "flexible_permissions" is part of the core and standard user permissions are implemented based on calculators.
1) I provide a user permission to add a post
2) but in my group type user don't have this permission
3) How would I get rid off this permission in Group module to make it work?

Feature request
Status

Fixed

Version

1.0

Component

Code

Created by

🇧🇪Belgium LOBsTerr

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024