Opened 8 years ago

Closed 3 years ago

Last modified 3 years ago

#9057 closed New feature (fixed)

Allow disabling contrib.auth auto creation of permissions

Reported by: Henrik Vendelbo Owned by: nobody
Component: contrib.auth Version: master
Severity: Normal Keywords: auth
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

If you wan't to create permissions and a superuser automatically in your own it's easy. Just follow the pattern used in contrib.auth

Then all you need to do is make contrib.auth stop creating permissions and superuser as well

Attachments (3)

9057.1.patch (576 bytes) - added by Henrik Vendelbo 8 years ago.
Add extra global settings
9057.2.patch (1.2 KB) - added by Henrik Vendelbo 8 years ago.
Check settings before creating permissions and superuser
9057.diff (3.7 KB) - added by Koen Biermans 5 years ago.
patch with no_default_permission meta option

Download all attachments as: .zip

Change History (12)

Changed 8 years ago by Henrik Vendelbo

Attachment: 9057.1.patch added

Add extra global settings

Changed 8 years ago by Henrik Vendelbo

Attachment: 9057.2.patch added

Check settings before creating permissions and superuser

comment:1 Changed 8 years ago by Malcolm Tredinnick

Triage Stage: UnreviewedDesign decision needed

A few issue here:

  1. This patch seems to be trying to slip in a configurable user-model. I can't see how that's related to the problem at hand.
  2. One patch, please, not two. I looked at the last patch, thinking it was the most up-to-date version and it looked incomplete. Then I realised that I had to read both at once.
  3. I'm -1 on including this at the moment. It's two extra settings, plus documentation (which isn't included here) to support something that happens once at syncdb time. If you don't want those permissions you can go in and delete them or write a script to do so. I'm relatively unconvinced that there's a really large use-case that is being overlooked by this not being present.

comment:2 Changed 7 years ago by DarwinSurvivor

While I'm not sure about the superuser part, I would find the ability to dissable auto-created permissions VERY usefull in the site I am currently designing.

Not only are there 3 permissions created per model, but the admin page does not even separate the auto-created ones from the purposely-created ones. My site has over 30 models (very complex research site) and having to go in and delete all the auto-created permissions every time I add a model is VERY annoying.

This seems like a simple fix and other than the missing tests/docs (which look like they would take all of 5 minutes to write), I am all for this.

comment:3 Changed 6 years ago by Gabriel Hurley

Component: Contrib appscontrib.auth

comment:4 Changed 6 years ago by Luke Plant

Severity: Normal
Type: New feature

Changed 5 years ago by Koen Biermans

Attachment: 9057.diff added

patch with no_default_permission meta option

comment:5 Changed 5 years ago by Koen Biermans

Easy pickings: unset
Needs documentation: set
UI/UX: unset

This patch has a different take: make it a meta option per model (called "no_default_permissions") to prevent creating the three default permissions for that model.

Added a test in a new folder regressiontests/auth_permissions since I did not know where to put them otherwise.

comment:6 Changed 5 years ago by Aymeric Augustin

Triage Stage: Design decision neededAccepted

comment:7 Changed 3 years ago by Tim Graham

Needs documentation: unset
Summary: allow override of contrib.auth auto creation of permissions and superuserAllow disabling contrib.auth auto creation of permissions
Version: 1.0master

Updating existing patch: PR

comment:8 Changed 3 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: newclosed

In ddae74b64ccb1173e3f2f06d54dd45643130f9e0:

Fixed #9057 -- Added default_permissions model meta option.

Thanks hvendelbo for the suggestion and koenb for the draft patch.

comment:9 Changed 3 years ago by Tim Graham <timograham@…>

In 453915bb1272c9a9189a741e6a9b9246edfcbd03:

SQLite test fix -- refs #9057

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