Opened 12 years ago
Last modified 9 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 |
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
Change History (3)
comment:1 by , 12 years ago
Triage Stage: | Unreviewed → Accepted |
---|---|
Version: | 1.5 → master |
comment:2 by , 9 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 , 9 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.