django / django/new-features

Group description field

Open
#44 3 comments 12 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
188
Forks
7
PR merge metrics
No merged PRs in 30d

Description

### Code of Conduct

- [x] 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

```python

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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with Django’s contrib.auth Group model and its admin form, then review the migration and documentation impacts of adding a blank description field between name and permissions. Done means administrators can edit and view the description immediately beneath the group name, with the documentation reviewed.

Written by the indexing model from the issue text.

Assessment

Tech stack
django, python
Domain
authorization, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.