Opened 12 years ago
Last modified 10 years ago
#20605 new New feature
Allow extending the default auth permissions
Reported by: | philipn | Owned by: | nobody |
---|---|---|---|
Component: | contrib.auth | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | me@… | Triage Stage: | Accepted |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Pull Requests: | How to create a pull request | ||
Description ¶
Currently, Django provides 'change', 'add', and 'delete' as base permissions which are created on syncdb
. I know you can set custom permissions on a per-model basis by listing them in Meta
, but sometimes you want a global base permission, e.g. 'view' (this is my use case).
It looks like it may be possible to just use a setting variable in contrib.auth.management
to accomplish this.
Currently using this workaround: http://blog.nyaruka.com/adding-a-view-permission-to-django-models
According to the ticket's flags, the next step(s) to move this issue forward are:
- To provide a patch by sending a pull request. Claim the ticket when you start working so that someone else doesn't duplicate effort. Before sending a pull request, review your work against the patch review checklist. Check the "Has patch" flag on the ticket after sending a pull request and 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 (3)
comment:1 by , 12 years ago
Triage Stage: | Unreviewed → Accepted |
---|---|
Version: | 1.5 → master |
comment:2 by , 10 years ago
Summary: | Custom base permissions → Allow extending the default auth permissions |
---|
#25087 is a duplicate with a patch (but as a setting).
comment:3 by , 10 years ago
Cc: | added |
---|
I don't see a reason to object to this request, so marking as accepted. And, 'view' permission is such a fundamental permission it is a bit strange that isn't available by default. At least being able to add it if needed would be a good thing...
A new global setting is likely going to be objected. Maybe after app-loading refactor this will be easier to tackle... Or maybe there could be some other API for adding permissions. For example, Permission model contains list of default permissions + a method to add more to that list.