Opened 6 years ago

Last modified 4 months ago

#7599 new New feature

add get_user_permissions method to ModelBackend

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


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

Attachments (2)

get_user_permissions.patch (1.1 KB) - added by gwilson 6 years ago.
get_user_permissions_patch_1.diff (2.4 KB) - added by jkistler 4 years ago.

Download all attachments as: .zip

Change History (16)

Changed 6 years ago by gwilson

comment:1 Changed 6 years ago by gwilson

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

comment:2 Changed 6 years ago by ericholscher

  • milestone set to post-1.0

comment:3 Changed 6 years ago by ericholscher

  • Triage Stage changed from Unreviewed to Design decision needed

comment:4 Changed 5 years ago by anonymous

  • milestone post-1.0 deleted

Milestone post-1.0 deleted

Changed 4 years ago by jkistler

comment:5 Changed 4 years ago by jkistler

Added documentation. Patch passes all existing auth tests.

comment:6 Changed 3 years ago by jezdez

  • milestone set to 1.3
  • Needs documentation unset
  • Triage Stage changed from Design decision needed to Accepted

comment:7 Changed 3 years ago by jezdez

  • Needs tests set

comment:8 Changed 3 years ago by ubernostrum

  • milestone 1.3 deleted

1.3 is feature-frozen now.

comment:9 Changed 3 years ago by lukeplant

  • Severity set to Normal
  • Type set to New feature

comment:10 Changed 2 years ago by aaugustin

  • UI/UX unset

Change UI/UX from NULL to False.

comment:11 Changed 2 years ago by aaugustin

  • Easy pickings unset

Change Easy pickings from NULL to False.

comment:12 Changed 9 months ago by timo

  • 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 4 months ago by jorgecarleitao

timo is right. I added a pull request,, 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 4 months ago by jorgecarleitao

  • Cc jorgecarleitao added

Add Comment

Modify Ticket

Change Properties
<Author field>
as new
The owner will be changed from (none) to anonymous. Next status will be 'assigned'
as The resolution will be set. Next status will be 'closed'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.