Opened 9 years ago

Closed 9 years ago

#2622 closed defect (fixed)

[patch] [per-object-permissions] has_perm breaks with anonymous users if an object is passed

Reported by: django25@… Owned by: clong
Component: Contrib apps Version: master
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Index: django/contrib/auth/models.py
===================================================================
--- django/contrib/auth/models.py       (revision 3680)
+++ django/contrib/auth/models.py       (working copy)
@@ -542,7 +542,7 @@
         raise NotImplementedError
     user_permissions = property(_get_user_permissions)

-    def has_perm(self, perm):
+    def has_perm(self, perm, object=None):
         return False

     def has_module_perms(self, module):

Seems reasonable to me. Stops it complaining anyway :-)

Change History (1)

comment:1 Changed 9 years ago by clong

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

(In [3682]) [per-object-permissions] Fixed #2622 and added in contains_permission method to the anonymous user model

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