#25229 closed Cleanup/optimization (fixed)
Docs for permission_required decorator don't describe behavior for multiple permission arguments
Reported by: | Brendan Jurd | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | 1.8 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The docs for permission_required say that you may pass in an iterable of permissions, but don't say anything about what that actually means. Does it require ANY of the listed permissions, or ALL?
To figure this out, the user has to look up the source code for permission_required, see that it calls has_perms(), and then look up the docs for has_perms to see that it requires ALL the listed permissions to be held. Sad trombone.
https://docs.djangoproject.com/en/1.8/topics/auth/default/#the-permission-required-decorator
Attachments (1)
Change History (5)
by , 9 years ago
Attachment: | 25229.diff added |
---|
follow-up: 2 comment:1 by , 9 years ago
Has patch: | set |
---|---|
Summary: | Docs for permission_required decorator doesn't describe behaviour for multiple permission arguments → Docs for permission_required decorator don't describe behavior for multiple permission arguments |
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 9 years ago
Note:
See TracTickets
for help on using tickets.
Does the attached patch look sufficient?