Opened 16 years ago

Closed 10 years ago

#7599 closed New feature (fixed)

add get_user_permissions method to ModelBackend

Reported by: Gary Wilson Owned by: jorgecarleitao
Component: contrib.auth Version: dev
Severity: Normal Keywords:
Cc: jorgecarleitao Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Makes the code more readable and creates a useful method for subclasses.

Attachments (2)

get_user_permissions.patch (1.1 KB ) - added by Gary Wilson 16 years ago.
get_user_permissions_patch_1.diff (2.4 KB ) - added by Jeff Kistler 14 years ago.

Download all attachments as: .zip

Change History (20)

by Gary Wilson, 16 years ago

Attachment: get_user_permissions.patch added

comment:1 by Gary Wilson, 16 years ago

Needs documentation: set

comment:2 by Eric Holscher, 16 years ago

milestone: post-1.0

comment:3 by Eric Holscher, 16 years ago

Triage Stage: UnreviewedDesign decision needed

comment:4 by (none), 15 years ago

milestone: post-1.0

Milestone post-1.0 deleted

by Jeff Kistler, 14 years ago

comment:5 by Jeff Kistler, 14 years ago

Added documentation. Patch passes all existing auth tests.

comment:6 by Jannis Leidel, 13 years ago

milestone: 1.3
Needs documentation: unset
Triage Stage: Design decision neededAccepted

comment:7 by Jannis Leidel, 13 years ago

Needs tests: set

comment:8 by James Bennett, 13 years ago

milestone: 1.3

1.3 is feature-frozen now.

comment:9 by Luke Plant, 13 years ago

Severity: Normal
Type: New feature

comment:10 by Aymeric Augustin, 12 years ago

UI/UX: unset

Change UI/UX from NULL to False.

comment:11 by Aymeric Augustin, 12 years ago

Easy pickings: unset

Change Easy pickings from NULL to False.

comment:12 by Tim Graham, 11 years ago

Needs documentation: set

Documentation isn't correct - this isn't a method on the User object, but on rather on ModelBackend which is documented at the bottom of docs/ref/contrib/auth.txt, although none of the methods for the backend are documented so presumably if we documented this one we'd want to document the rest. This ticket also has "needs tests" set, and while I imagine we could test the ability to override the method in a custom backend, I'm not convinced it's necessary as it doesn't look like the rest of the backend is tested in such a way.

comment:13 by jorgecarleitao, 10 years ago

timo is right. I added a pull request, https://github.com/django/django/pull/2127, that fixes the docs of ModelBackend and apply the patch.

I didn't added a test case because, like timo argued, the backend is not tested anyway. I will fill a ticket reporting this.

comment:14 by jorgecarleitao, 10 years ago

Cc: jorgecarleitao added

comment:15 by jorgecarleitao, 10 years ago

Owner: set to jorgecarleitao
Status: newassigned

comment:16 by Tim Graham, 10 years ago

Needs documentation: unset
Needs tests: unset
Patch needs improvement: set

Please uncheck "Patch needs improvement" when you update the PR, thanks.

comment:18 by Tim Graham <timograham@…>, 10 years ago

Resolution: fixed
Status: assignedclosed

In cc35bd461d35da2b03c0a1a8ff92123d716db9a9:

Fixed #7599 -- Added get_user_permissions to ModelBackend.

Thanks to @gdub for the report and intial patch and
@charettes and @timgraham for the review.

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