4487 was the trigger for this issue here.
Our Drupal brethren started implementing this and were originally planning to add it in Drupal 8.5.0:
- Change record (draft): Permissions may be marked deprecated in the permission definition
- Issue (still open - now against Drupal 9.2.x): https://www.drupal.org/project/drupal/issues/2924785
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.
Recent comments
@yorkshirepudding - Thank you! That's just what I needed. In the code, it's actually fontyourface_ui_settings_form (with underscores rather than dashes). Now it's working ... I only have to figure...
Question about hook_form_FORM_ID_alter
Oh the benefits of a new set of eyes.... I don't know how many times I've looked at that css and not spotted that! Mind you, in my defense, my eyes are over 70 years old (and obviously in need of...
How to over-ride grid-flexbox.css
thanks yorkshirepudding, i used the CSS Injector option with this code and it works .views-table caption { font-weight: bold; color: blue; font-size: 26px; }
How to change the format of the Views group title field?