Opened 7 years ago

Closed 10 months ago

#7599 closed New feature (fixed)

add get_user_permissions method to ModelBackend

Reported by: gwilson 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 gwilson 7 years ago.
get_user_permissions_patch_1.diff (2.4 KB) - added by jkistler 5 years ago.

Download all attachments as: .zip

Change History (20)

Changed 7 years ago by gwilson

comment:1 Changed 7 years ago by gwilson

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

comment:2 Changed 7 years ago by ericholscher

  • milestone set to post-1.0

comment:3 Changed 7 years ago by ericholscher

  • Triage Stage changed from Unreviewed to Design decision needed

comment:4 Changed 6 years ago by anonymous

  • milestone post-1.0 deleted

Milestone post-1.0 deleted

Changed 5 years ago by jkistler

comment:5 Changed 5 years ago by jkistler

Added documentation. Patch passes all existing auth tests.

comment:6 Changed 4 years ago by jezdez

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

comment:7 Changed 4 years ago by jezdez

  • Needs tests set

comment:8 Changed 4 years ago by ubernostrum

  • milestone 1.3 deleted

1.3 is feature-frozen now.

comment:9 Changed 4 years ago by lukeplant

  • Severity set to Normal
  • Type set to New feature

comment:10 Changed 3 years ago by aaugustin

  • UI/UX unset

Change UI/UX from NULL to False.

comment:11 Changed 3 years ago by aaugustin

  • Easy pickings unset

Change Easy pickings from NULL to False.

comment:12 Changed 20 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 15 months 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 15 months ago by jorgecarleitao

  • Cc jorgecarleitao added

comment:15 Changed 11 months ago by jorgecarleitao

  • Owner set to jorgecarleitao
  • Status changed from new to assigned

comment:16 Changed 10 months ago by timo

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

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

comment:18 Changed 10 months ago by Tim Graham <timograham@…>

  • Resolution set to fixed
  • Status changed from assigned to closed

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