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
1 changed files with 5 additions and 1 deletions

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)