Give roles a description value

Created on 8 May 2008, about 16 years ago
Updated 3 December 2023, 7 months ago

Problem/Motivation

It would be useful to be able to document on the site why a certain role exists.

Proposed resolution

Add a property "description" to the config entity type "user_role".

Remaining tasks

  • Needs update to configuration tarballs (see #48)

User interface changes

  • On /admin/people/roles a column "Description" is added to the role table.

    Before

    After

  • On the role edit page (for example /admin/people/roles/manage/anonymous), a description field is added.

    Before

    After

API changes

\Drupal\user\RoleInterface gets two new methods:

  • getDescription()
  • setDescription()

Data model changes

  • The config entity type "user_role" gets a new property called "description".
  • Upon installation of the user module, the roles "anonymous" and "authenticated" get a default description.
  • Upon installation using the profile "demo_umami", the roles "administrator", "anonymous", "authenticated", "author" and "editor" get a default description.
  • Upon installation using the profile "standard", the roles "administrator", "anonymous" and "authenticated" get a default description.
  • On a post update, the roles "anonymous" and "authenticated" get a description.

Release notes snippet

Original report by webchick

Kind of a sister issue to #228061: Usability UMN: Allow roles to be weighted in terms of role usability, I'd love the way to add *descriptions* to roles as well. This would be able to act as documentation for site admins as to 'why' a role exists.

Feature request
Status

Needs work

Version

11.0 🔥

Component
User system 

Last updated about 10 hours ago

Created by

🇨🇦Canada webchick Vancouver 🇨🇦

Live updates comments and jobs are added and updated live.
  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

Missing content requested by

🇦🇺Australia dpi
7 months ago
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024