Commit fb11fb76 authored by 's avatar

backed out trying object.__roles__ first

parent 42affe51
......@@ -96,20 +96,16 @@ def default__class_init__(self):
have=dict.has_key
ft=type(default__class_init__)
dict_items=dict.items()
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_':
if not hasattr(v, '__roles__'):
try: v.__roles__ = ('Manager',)
except:
# This attribute can't hold a __roles__
# attribute. Try to store __roles__ in the
# class instead.
nr = name + '__roles__'
if not have(nr):
try: dict[nr] = ('Manager',)
except: pass
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',
# 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