disable checkboxes inherited from authenticated user role on role-specific permissions page

Created on 13 September 2024, 3 months ago
Updated 16 September 2024, 3 months ago

Problem/Motivation

On the /admin/people/permissions page, when a permission is checked for the "Authenticated user" role, that permission is inherited by all custom roles, and the checkbox becomes disabled and grayed out in the UI.

However, on /admin/people/permissions/{user_role}, there's no indication that a permission has already been inherited from the "Authenticated user" role. Admins can still check these boxes, which creates redundant permissions and complicates the permission structure. Using the role-specific permissions pages, admins can easily miss inherited permissions, leading to confusion.

This issue is particularly glaring on larger or enterprise sites with many user roles and contrib modules, where the main permissions page (/admin/people/permissions) is slow to load.

Steps to reproduce

  1. Install Drupal 10 or 11, with the "Standard" install profile, which provides an additional "Content editor" role.
  2. Visit /admin/people/permissions and see that "Content editor" role inherits access to the "Basic HTML" text filter. The checkbox is disabled and checked.
  3. Then visit admin/people/permissions/content_editor and see that the checkbox for "Basic HTML" text filter is enabled and unchecked.

Proposed resolution

  1. Permissions that are inherited from the Authenticated User role should be checked and disabled on role-specific permissions pages.
  2. Ideally, provide an explanation somewhere on screen of why the item is disable, with text like "permission granted via the Authenticated user role".

Remaining tasks

Discuss UX implications and settle on an implementation approach.
Write patch.

User interface changes

Role-specific permissions pages will show inherited permissions as "enabled" and "uneditable", consistent with the main permissions matrix behavior.

Site admins will now be able to see when a user role has been granted permission to do something via an inherited permission. This will provide necessary in-page context to make better decisions when modifying other permissions.

Introduced terminology

API changes

Data model changes

It will no longer be possible to store redundant permissions from the Role-specific permission pages.

Release notes snippet

✨ Feature request
Status

Active

Version

11.0 πŸ”₯

Component
User systemΒ  β†’

Last updated about 6 hours ago

Created by

πŸ‡ͺπŸ‡¨Ecuador jwilson3

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

Comments & Activities

Production build 0.71.5 2024