1
0
mirror of https://github.com/django/django.git synced 2024-12-23 01:25:58 +00:00

Fixed #2418 -- Fixed obsolete method call in PermLookupDict.__repr__. Thanks,

DarkElf109@ibendit.com.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3798 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick 2006-09-23 08:35:10 +00:00
parent 26954aa3d0
commit 93597d051d

View File

@ -51,15 +51,19 @@ def request(request):
class PermLookupDict(object):
def __init__(self, user, module_name):
self.user, self.module_name = user, module_name
def __repr__(self):
return str(self.user.get_permission_list())
return str(self.user.get_all_permissions())
def __getitem__(self, perm_name):
return self.user.has_perm("%s.%s" % (self.module_name, perm_name))
def __nonzero__(self):
return self.user.has_module_perms(self.module_name)
class PermWrapper(object):
def __init__(self, user):
self.user = user
def __getitem__(self, module_name):
return PermLookupDict(self.user, module_name)