Commit 2827ed2a authored by Jim Fulton's avatar Jim Fulton

Changed to use *both* class-defined and inherited permissions.

parent 766556a7
......@@ -274,12 +274,12 @@ class PermissionMapperManager(Acquisition.Implicit):
# ugh
perms={}
for p in self.classDefinedPermissions():
for p in self.classDefinedAndInheritedPermissions():
perms[pname(p)]=p
r=[]
a=r.append
for name, who_cares in method.__ac_permissions__:
for name, who_cares in method.ac_inherited_permissions(1):
p=perms.get(getPermissionMapping(name, wrapper), '')
a({'permission_name': name, 'class_permission': p})
return r
......@@ -291,7 +291,7 @@ class PermissionMapperManager(Acquisition.Implicit):
"""
wrapper=trueself.__dict__['_wrapper___']
perms=trueself.classDefinedPermissions()
perms=trueself.classDefinedAndInheritedPermissions()
for i in range(len(permission_names)):
name=permission_names[i]
p=class_permissions[i]
......
......@@ -202,6 +202,7 @@ class ZClass(OFS.SimpleItem.SimpleItem):
self._zclass_=c=type(PersistentClass)(
id, tuple(args),
PersistentClassDict(title or id))
c.__ac_permissions__=()
# Create the class(/instance) prop sheet *class*
csheets_class=type(PersistentClass)(
......@@ -327,6 +328,10 @@ class ZClass(OFS.SimpleItem.SimpleItem):
r.sort()
return r
def classDefinedAndInheritedPermissions(self):
return (self.classDefinedPermissions()+
self.classInheritedPermissions())
def ziconImage(self, REQUEST, RESPONSE):
"Display a class icon"
return self._zclass_.ziconImage.index_html(REQUEST, RESPONSE)
......
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