--
Ticket URL: <https://code.djangoproject.com/ticket/17903>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* stage: Unreviewed => Design decision needed
* needs_tests: => 0
* needs_docs: => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/17903#comment:1>
* stage: Design decision needed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/17903#comment:2>
Comment (by jorgecarleitao):
I checked the code, and get_all_permissions does the following:
{{{
If user is anonymous: returns empty set.
else: joins "user permissions" with "user groups permissions".
}}}
In "user groups permissions", if the user is superuser, this returns all
permissions.
So, in {{{has_perm}}} and {{{has_module_perms}}} we check for
{{{is_active}}}, but in {{{get_all_permissions}}} we check for
{{{is_anonymous}}}.
Shouldn't this be consistent?
--
Ticket URL: <https://code.djangoproject.com/ticket/17903#comment:3>
* cc: jorgecarleitao (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/17903#comment:4>
* status: new => assigned
* owner: nobody => jorgecarleitao
Comment:
Pull request [https://github.com/django/django/pull/2636]
--
Ticket URL: <https://code.djangoproject.com/ticket/17903#comment:5>
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/17903#comment:6>
* needs_better_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/17903#comment:7>
* needs_better_patch: 1 => 0
Comment:
To be consistent, I made both `get_all_permissions`,
`get_user_permissions` and `get_group_permissions` to require the user to
be active.
--
Ticket URL: <https://code.djangoproject.com/ticket/17903#comment:8>
* needs_better_patch: 0 => 1
Comment:
Left comments for how to improve the tests.
--
Ticket URL: <https://code.djangoproject.com/ticket/17903#comment:9>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"c33447a50c1b0a96c6e2261f7c45d2522a3fe28d"]:
{{{
#!CommitTicketReference repository=""
revision="c33447a50c1b0a96c6e2261f7c45d2522a3fe28d"
Fixed #17903 -- Modified ModelBackend to eliminate permissions on inactive
users.
Thanks to @SmileyChris for the report and @timgraham for review.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/17903#comment:10>
Comment (by Tim Graham <timograham@…>):
In [changeset:"150d88cc2c0866ef65f077387e3e560e9c9c3f80"]:
{{{
#!CommitTicketReference repository=""
revision="150d88cc2c0866ef65f077387e3e560e9c9c3f80"
Restored is_anonymous() check in ModelBackend permission checking removed
in refs #17903.
Thanks Florian Apolloner for raising the issue.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/17903#comment:11>