Opened 18 years ago

Closed 18 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: Chris Long
Component: Contrib apps Version: dev
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

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 by Chris Long, 18 years ago

Resolution: fixed
Status: newclosed

(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