Ticket #13539: r16544_13539.diff
File r16544_13539.diff, 2.0 KB (added by , 13 years ago) |
---|
-
django/contrib/admin/util.py
88 88 None, (quote(obj._get_pk_val()),)) 89 89 p = '%s.%s' % (opts.app_label, 90 90 opts.get_delete_permission()) 91 if not user.has_perm(p ):91 if not user.has_perm(p, obj): 92 92 perms_needed.add(opts.verbose_name) 93 93 # Display a link to the admin page. 94 94 return mark_safe(u'%s: <a href="%s">%s</a>' % -
django/contrib/auth/tests/auth_backends.py
347 347 def test_has_module_perms(self): 348 348 self.assertEqual(self.user1.has_module_perms("app1"), False) 349 349 self.assertEqual(self.user1.has_module_perms("app2"), False) 350 -
django/contrib/auth/models.py
153 153 if (not active and not anon and backend.supports_inactive_user) or \ 154 154 (not anon or backend.supports_anonymous_user): 155 155 if hasattr(backend, "has_perm"): 156 if obj is not None: 157 if (backend.supports_object_permissions and 158 backend.has_perm(user, perm, obj)): 159 return True 160 else: 161 if backend.has_perm(user, perm): 162 return True 156 if obj is not None and backend.supports_object_permissions: 157 return backend.has_perm(user, perm, obj) 158 return backend.has_perm(user, perm) 163 159 return False 164 160 165 161