Commit e71adc76 authored by 's avatar

Fixed hasRole bug for superuser

parent a27633eb
"""Access control package""" """Access control package"""
__version__='$Revision: 1.38 $'[11:-2] __version__='$Revision: 1.39 $'[11:-2]
from PersistentMapping import PersistentMapping from PersistentMapping import PersistentMapping
...@@ -54,7 +54,6 @@ class User(Implicit, Persistent): ...@@ -54,7 +54,6 @@ class User(Implicit, Persistent):
def __str__(self): return self.name def __str__(self): return self.name
__repr__=__str__ __repr__=__str__
try: try:
f=open('%s/access' % SOFTWARE_HOME, 'r') f=open('%s/access' % SOFTWARE_HOME, 'r')
data=split(strip(f.readline()),':') data=split(strip(f.readline()),':')
...@@ -64,6 +63,8 @@ try: ...@@ -64,6 +63,8 @@ try:
except: except:
super=User('superuser','123',('manage',)) super=User('superuser','123',('manage',))
super.hasRole=lambda parent, roles=None: 1
nobody=User('Anonymous User','',('Anonymous',)) nobody=User('Anonymous User','',('Anonymous',))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment