Provide a mechanism to deprecate permissions

Created on 19 November 2017, about 7 years ago
Updated 23 January 2023, almost 2 years ago

Problem/Motivation

Wherever possible, Drupal 8 code should deprecate β†’ instead of removing old code, behaviors, etc.

Permission machine names are stored in user role configurations, but they are also used in code for many things like access checks. This means that if core updates the machine name of a permission, even if it provides an upgrade path, contributed module code that checks against the core permissions might start to deny access that should be allowed.

Marked major because it affects how thoroughly we can implement our backwards compatibility policy.

Proposed resolution

Provide a mechanism to deprecate permissions in the permission definition.

Remaining tasks

  • Needs review.
  • Followup to explore how to raise warnings when a deprecated permission is used.

User interface changes

If no deprecated permissions are used, there is no UI change: unused deprecated permissions are simply not presented to the user.

If a deprecated permission is in use, the user will see a short message under the permission. The permission can be revoked from roles that have it through the UI, but not granted to additional roles (unchecked checkboxes for it will be disabled).

A message will also be provided on the status report.

API changes

A deprecated key is added to the permission definition API.

Data model changes

πŸ“Œ Task
Status

Needs work

Version

10.1 ✨

Component
User moduleΒ  β†’

Last updated 7 days ago

Created by

πŸ‡ΊπŸ‡ΈUnited States xjm

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request β†’ as a guide.

    Yes this would be great feature!

    At this time we will need a D10 version of the patch and there were changes requested in #44 that should be addressed

    Please do not just reroll.

Production build 0.71.5 2024