Problem/Motivation

We sometimes override role permissions and it would be useful if a warning could be displayed on /admin/people/permissions.

Steps to reproduce

Create a class implementing ConfigFactoryOverrideInterface that adds some permissions:

  public function loadOverrides($names): array {
    $overrides = [];
    if (in_array('user.role.webmestre', $names)) {
      $overrides['user.role.webmestre']['permissions'][9999] = 'foo';
      $overrides['user.role.webmestre']['permissions'][9998] = 'bar';
    }

    return $overrides;
  }

Proposed resolution

FormOverrides::getFormConfigNames() should handle UserPermissionsForm.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

prudloff created an issue. See original summary.

prudloff’s picture

Status: Active » Needs review
prudloff’s picture

prudloff’s picture

Merged the latest 8.x-1.x to get CI tests.
phpunit failures seem to be unrelated, I can reproduce them even if I revert my changes: #3511601: Failing phpunit tests

I also quickly checked if core now handles this: it does not.

arousseau’s picture

Status: Needs review » Reviewed & tested by the community

The MR applies cleanly to 1.4 and the warning is displayed on /admin/people/permissions. Looks ready.

prudloff’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • prudloff committed 5286374c on 8.x-1.x
    feat: #3275425 Warn when permissions are overridden
    
    By: prudloff
    

Status: Fixed » Closed (fixed)

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