Opened 8 years ago

Closed 2 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: master
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 8 years ago.
get_user_permissions_patch_1.diff (2.4 KB) - added by Jeff Kistler 6 years ago.

Download all attachments as: .zip

Change History (20)

Changed 8 years ago by Gary Wilson

Attachment: get_user_permissions.patch added

comment:1 Changed 8 years ago by Gary Wilson

Needs documentation: set

comment:2 Changed 8 years ago by Eric Holscher

milestone: post-1.0

comment:3 Changed 8 years ago by Eric Holscher

Triage Stage: UnreviewedDesign decision needed

comment:4 Changed 8 years ago by (none)

milestone: post-1.0

Milestone post-1.0 deleted

Changed 6 years ago by Jeff Kistler

comment:5 Changed 6 years ago by Jeff Kistler

Added documentation. Patch passes all existing auth tests.

comment:6 Changed 6 years ago by Jannis Leidel

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

comment:7 Changed 6 years ago by Jannis Leidel

Needs tests: set

comment:8 Changed 6 years ago by James Bennett

milestone: 1.3

1.3 is feature-frozen now.

comment:9 Changed 6 years ago by Luke Plant

Severity: Normal
Type: New feature

comment:10 Changed 5 years ago by Aymeric Augustin

UI/UX: unset

Change UI/UX from NULL to False.

comment:11 Changed 5 years ago by Aymeric Augustin

Easy pickings: unset

Change Easy pickings from NULL to False.

comment:12 Changed 3 years ago by Tim Graham

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 Changed 3 years ago by jorgecarleitao

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 Changed 3 years ago by jorgecarleitao

Cc: jorgecarleitao added

comment:15 Changed 3 years ago by jorgecarleitao

Owner: set to jorgecarleitao
Status: newassigned

comment:16 Changed 3 years ago by Tim Graham

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

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

comment:18 Changed 2 years ago by Tim Graham <timograham@…>

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