[Django] #25229: Docs for permission_required decorator doesn't describe behaviour for multiple permission arguments

6 views
Skip to first unread message

Django

unread,
Aug 5, 2015, 11:59:51 AM8/5/15
to django-...@googlegroups.com
#25229: Docs for permission_required decorator doesn't describe behaviour for
multiple permission arguments
--------------------------------------+--------------------
Reporter: direvus | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 1.8
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+--------------------
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

--
Ticket URL: <https://code.djangoproject.com/ticket/25229>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Aug 5, 2015, 2:02:02 PM8/5/15
to django-...@googlegroups.com
#25229: Docs for permission_required decorator doesn't describe behaviour for
multiple permission arguments
----------------------------------+----------------------------

Reporter: direvus | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 1.8
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Easy pickings: 0
UI/UX: 0 |
----------------------------------+----------------------------
Changes (by timgraham):

* Attachment "25229.diff" added.

Django

unread,
Aug 5, 2015, 2:02:42 PM8/5/15
to django-...@googlegroups.com
#25229: Docs for permission_required decorator don't describe behavior for multiple
permission arguments
--------------------------------------+------------------------------------

Reporter: direvus | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by timgraham):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
* has_patch: 0 => 1
* stage: Unreviewed => Accepted


Comment:

Does the attached patch look sufficient?

--
Ticket URL: <https://code.djangoproject.com/ticket/25229#comment:1>

Django

unread,
Aug 5, 2015, 3:58:23 PM8/5/15
to django-...@googlegroups.com
#25229: Docs for permission_required decorator don't describe behavior for multiple
permission arguments
--------------------------------------+------------------------------------
Reporter: direvus | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by direvus):

Replying to [comment:1 timgraham]:


> Does the attached patch look sufficient?

Yes, that looks great, thanks Tim!

--
Ticket URL: <https://code.djangoproject.com/ticket/25229#comment:2>

Django

unread,
Aug 5, 2015, 5:16:14 PM8/5/15
to django-...@googlegroups.com
#25229: Docs for permission_required decorator don't describe behavior for multiple
permission arguments
--------------------------------------+------------------------------------
Reporter: direvus | Owner: nobody
Type: Cleanup/optimization | Status: closed
Component: Documentation | Version: 1.8
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"16a8d01308f8ca4a7b4673424059424ba3fe36c8" 16a8d01]:
{{{
#!CommitTicketReference repository=""
revision="16a8d01308f8ca4a7b4673424059424ba3fe36c8"
Fixed #25229 -- Clarified how an iterable works with @permission_required
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25229#comment:3>

Django

unread,
Aug 5, 2015, 5:19:09 PM8/5/15
to django-...@googlegroups.com
#25229: Docs for permission_required decorator don't describe behavior for multiple
permission arguments
--------------------------------------+------------------------------------
Reporter: direvus | Owner: nobody
Type: Cleanup/optimization | Status: closed
Component: Documentation | Version: 1.8

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"a7fb311aced5469dbf2588d860579be87b67e3d9" a7fb311]:
{{{
#!CommitTicketReference repository=""
revision="a7fb311aced5469dbf2588d860579be87b67e3d9"
[1.8.x] Fixed #25229 -- Clarified how an iterable works with
@permission_required

Backport of 16a8d01308f8ca4a7b4673424059424ba3fe36c8 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25229#comment:4>

Reply all
Reply to author
Forward
0 new messages