Commit 5fdc5ef2 authored by Evan Simpson's avatar Evan Simpson

Made application of __roles__ attempt attribute assignment first.

parent 2f8660ad
......@@ -228,7 +228,8 @@ class ProductContext:
},)
m[name]=initial
m[name+'__roles__']=pr
try: initial.__roles__=pr
except: m[name+'__roles__']=pr
for method in constructors[1:]:
if type(method) is tt: name, method = method
......@@ -236,7 +237,8 @@ class ProductContext:
name=os.path.split(method.__name__)[-1]
if not productObject.__dict__.has_key(name):
m[name]=method
m[name+'__roles__']=pr
try: method.__roles__ = pr
except: m[name+'__roles__']=pr
if icon:
name=os.path.split(icon)[1]
......
......@@ -99,12 +99,10 @@ def default__class_init__(self):
for name, v in dict_items:
if hasattr(v,'_need__name__') and v._need__name__:
v.__dict__['__name__']=name
if name=='manage' or name[:7]=='manage_':
name=name+'__roles__'
if not have(name): dict[name]='Manager',
elif name=='manage' or name[:7]=='manage_' and type(v) is ft:
name=name+'__roles__'
if not have(name): dict[name]='Manager',
if ((name=='manage' or name[:7]=='manage_') and
not hasattr(v, '__roles__')):
try: v.__roles__ = ('Manager',)
except: dict[name+'__roles__'] = ('Manager',)
# Look for a SecurityInfo object on the class. If found, call its
# apply() method to generate __ac_permissions__ for the class. We
......
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