Commit 02dac98d authored by Yoshinori Okuji's avatar Yoshinori Okuji

Implement permissions in modules correctly.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@780 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b61ad7bd
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
from Globals import PersistentMapping from Globals import PersistentMapping
from Acquisition import Implicit from Acquisition import Implicit
from App.Permission import Permission from AccessControl.Permission import Permission
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from Products.CMFCore.utils import getToolByName from Products.CMFCore.utils import getToolByName
from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface
...@@ -205,18 +205,18 @@ class ModuleTemplateItem(Implicit): ...@@ -205,18 +205,18 @@ class ModuleTemplateItem(Implicit):
self.module_id = module.getId() self.module_id = module.getId()
self.module_type = module.getPortalType() self.module_type = module.getPortalType()
self.module_permission_list = [] self.module_permission_list = []
# XXX Disabled because this makes the zexp file for p in module.ac_inherited_permissions(1):
# very big (more than 40 Mo instead of 1 Mo) name, value = p[:2]
#for p in module.ac_inherited_permissions(1): role_list = Permission(name, value, module).getRoles()
# name, value = p[:2] self.module_permission_list.append((name, role_list))
# permission=Permission(name,value,module)
# self.module_permission_list.append(permission)
def install(self, local_configuration): def install(self, local_configuration):
portal = local_configuration.getPortalObject() portal = local_configuration.getPortalObject()
if self.module_id not in portal.objectIds(): # No renaming mapping for now if self.module_id not in portal.objectIds(): # No renaming mapping for now
portal.newContent(id=self.module_id, portal_type=self.module_type) module = portal.newContent(id=self.module_id, portal_type=self.module_type)
# Missing permissions for name,role_list in self.module_permission_list:
aquire = (type(role_list) == type([]))
module.manage_permission(name, roles=role_list, aquire=aquire)
class BusinessTemplate(XMLObject): class BusinessTemplate(XMLObject):
""" """
......
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