Opened 10 years ago
Last modified 7 years ago
#24754 new New feature
Implementation of global permissions
Reported by: | autrilla | Owned by: | nobody |
---|---|---|---|
Component: | contrib.auth | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | me@…, Mariusz Felisiak | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Pull Requests: | |||
Description ¶
Right now, there are two ways of creating Permissions, either through a Model's Meta class, or using the Permission.objects.create method. The problem is, both of this ways require having the permission attached to a model, even when sometimes it does not really make sense. There are ways to work around this, of course, such as creating a dummy model just to hold permissions that don't really fit anywhere or overriding the default User model and fitting them there. Possible solutions I can think of are either removing the mandatory ContentType specification on the Permission model or providing a 'global' ContentType.
According to the ticket's flags, the next step(s) to move this issue forward are:
- To improve the patch as described in the pull request review comments or on this ticket, then uncheck "Patch needs improvement".
If creating a new pull request, include a link to the pull request in the ticket comment when making that update. The usual format is:
[https://github.com/django/django/pull/#### PR]
.
Change History (6)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
Triage Stage: | Unreviewed → Accepted |
---|---|
Version: | 1.8 → master |
comment:3 by , 10 years ago
Cc: | added |
---|
comment:4 by , 7 years ago
Has patch: | set |
---|
comment:5 by , 7 years ago
Cc: | added |
---|
comment:6 by , 7 years ago
Patch needs improvement: | set |
---|
Permissions were designed for the admin. It shows. I agree that it's an unfortunate design and we should try to do better. I've faced this issue repeatedly myself. In applications, not every concept is built upon a Django model!