By xjm on
Change record status:
Draft (View all draft change records)
Project:
Introduced in branch:
12.x
Introduced in version:
12.0.0
Issue links:
Description:
Permission machine names are stored in role configurations, but they are also a public API since it is common to add customized access checks or use existing permissions to control access to added functionality. For this reason, permission machine names should not be changed or removed within a major version.
In order to allow permission changes with backwards compatibility, a new 'deprecated' key has been added to permission definitions. (See PermissionHandlerInterface for more information on permission definitions.)
To deprecate a permission, a module must do two things:
- Mark the permission as deprecated in its
*.permissions.ymlfile:
update any media: title: 'Update any media' deprecated: The "%permission%" permission is deprecated in drupal:12.0.0 and is removed from drupal:12.1.0. Use the bundle-specific "update any $type media" permissions instead. - Provide an upgrade path to update roles to change permissions as appropriate.