Opened 23 months ago

Last modified 23 months ago

#20605 new New feature

Custom base permissions

Reported by: philipn Owned by: nobody
Component: contrib.auth Version: master
Severity: Normal Keywords:
Cc: 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 (1)

comment:1 Changed 23 months ago by akaariai

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted
  • Version changed from 1.5 to master

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.

Note: See TracTickets for help on using tickets.
Back to Top