Commit a2fd7ad8 authored by Jérome Perrin's avatar Jérome Perrin

honor property sheet's read_permission for preference tool accessors


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@37218 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 42eb2b36
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from AccessControl.SecurityManagement import getSecurityManager,\ from AccessControl.SecurityManagement import getSecurityManager,\
setSecurityManager, newSecurityManager setSecurityManager, newSecurityManager
from AccessControl.PermissionRole import PermissionRole
from MethodObject import Method from MethodObject import Method
from Products.ERP5Type.Globals import InitializeClass, DTMLFile from Products.ERP5Type.Globals import InitializeClass, DTMLFile
from zLOG import LOG, PROBLEM from zLOG import LOG, PROBLEM
...@@ -109,6 +110,10 @@ def createPreferenceToolAccessorList(portal) : ...@@ -109,6 +110,10 @@ def createPreferenceToolAccessorList(portal) :
for attribute_name in attr_list: for attribute_name in attr_list:
method = PreferenceMethod(attribute_name, prop.get('default')) method = PreferenceMethod(attribute_name, prop.get('default'))
setattr(PreferenceTool, attribute_name, method) setattr(PreferenceTool, attribute_name, method)
read_permission = prop.get('read_permission')
if read_permission:
setattr(PreferenceTool, attribute_name + '__roles__',
PermissionRole(read_permission))
class func_code: pass class func_code: pass
......
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