PermissionHandler should cache built permissions

Created on 23 August 2023, over 1 year ago

Problem/Motivation

I have no idea why, but PermissionHandler does not cache permissions.

All calls to \Drupal\user\PermissionHandler::getPermissions go straight to \Drupal\user\PermissionHandler::buildPermissionsYaml which does disk scan and YAML decoding. It can be pretty expensive.

I have no idea why this isn't cached and couldn't find anything in the issue queue.

Proposed resolution

\Drupal\user\PermissionHandler::getPermissions should cache the built and sorted permissions. Invalidated whenever a module is installed.

Provide a 'permissions' cache tag.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component
User moduleΒ  β†’

Last updated about 11 hours ago

Created by

πŸ‡ΊπŸ‡ΈUnited States mglaman WI, USA

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

Comments & Activities

Production build 0.71.5 2024