Skip to content

Group description field #44

Open
Open
@mdewhirst

Description

@mdewhirst

Code of Conduct

  • I agree to follow Django's Code of Conduct

Feature Description

In the contrib.auth.group model I'd like to see a text field, group.description, between group.name and group.permissions. In the Admin it would appear immediately beneath the group name.

Problem

Groups, are also roles. Different roles demand different sets of permissions. IMHO, individual permissions are bad corporate security policy. Some roles can be sufficiently complex that there should be some way of documenting the requirements so that administrators and managers can understand which roles should be assigned to which users.

A simple text field 'Description' would potentially solve that problem.

Request or proposal

proposal

Additional Details

As a recent example, although unrelated to permissions on this occasion, I offered one of my customers the unofficial role of "Product owner" in return for a subscription discount. I will now use a group called "owner" so I can automate the offered discount. Without a description field documenting the intent of that group the next person in my position won't have a clue what that group is about.

BTW, here are all the group names in the above project ... admin, agent, author, authority, consultant, manager, oecd and user. The user group covers user profile editing and company profile visibility.

Implementation Suggestions

class Group(models.Model):
    """ contrib.auth.models """
    name = models.CharField(_("name"), max_length=150, unique=True)
    # new field 'description' for documenting intent of this group
    description = models.TextField(
        verbose_name=_("description"),
        blank=True,
    )
    permissions = models.ManyToManyField(
        Permission,
        verbose_name=_("permissions"),
        blank=True,
    )
    ...

I have tried this locally and after migration it appears to work. The documentation would need to be reviewed and I would happily do that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Idea

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions