Opened 11 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 Anssi Kääriäinen, 11 years ago

Triage Stage: UnreviewedAccepted
Version: 1.5master

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.

comment:2 by Tim Graham, 9 years ago

Summary: Custom base permissionsAllow extending the default auth permissions

#25087 is a duplicate with a patch (but as a setting).

comment:3 by Adam Johnson, 9 years ago

Cc: me@… added
Note: See TracTickets for help on using tickets.
Back to Top