Create a a way to filter/modify a permissions list prior to display in the UI.

Created on 13 July 2023, over 1 year ago
Updated 11 July 2024, 8 months ago

Problem/Motivation

There are scenarios where it would be useful to have centralized control over permissions lists, such as the form that appears in admin/people/permissions. While this change could be achieved via form alters, there are some notable advantages to having control over this permissions list before it reaches the form render array

  • There are multiple forms that list permissions (admin/people/permissions, user permissions, role permissions, etc). Filtering the list in one place is much simpler than altering multiple forms
  • These permissions list forms are very large, complex render arrays. Dozens+ LOC manipulating the render array can be replaced with a simpler (and much more readable) event subscriber.

Steps to reproduce

Proposed resolution

Create an event in the permissions form permissionsByProvider() that allows an event subscriber to filter the list of permissions before it is rendered by the form.

Provide the functionality by passing an array_filter() callback. This ensures that while it empowers the user to remove items from the permissions list, those items can't be changed in any other way (renamed, etc).

Remaining tasks

User interface changes

None.

API changes

Adds a new event to allow filtering of permissions rendered by permission forms.

Data model changes

None.

Release notes snippet

Feature request
Status

Needs work

Version

11.0 🔥

Component
User system 

Last updated 1 day ago

Created by

🇺🇸United States bnjmnm Ann Arbor, MI

Live updates comments and jobs are added and updated live.
  • Needs framework manager review

    It is used to alert the framework manager core committer(s) that an issue significantly impacts (or has the potential to impact) multiple subsystems or represents a significant change or addition in architecture or public APIs, and their signoff is needed (see the governance policy draft for more information). If an issue significantly impacts only one subsystem, use Needs subsystem maintainer review instead, and make sure the issue component is set to the correct subsystem.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024