Commit dc415f1a authored by Paul Graydon's avatar Paul Graydon

wendelin_telecom_security: Add Local Role management for Data Array Line

parent e105c711
<type_roles>
<role id='Auditor'>
<property id='title'>Administrator</property>
<multi_property id='category'>function/administrator</multi_property>
</role>
<role id='Auditor'>
<property id='title'>Client</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromParentRelatedDataAnalysisLine</property>
<multi_property id='category'>function/user</multi_property>
<multi_property id='base_category'>destination_project</multi_property>
</role>
</type_roles>
\ No newline at end of file
"""
This script returns a list of dictionaries which represent
the security groups which a person is member of. It extracts
the categories from the specified items related to the current content.
The parameters are
base_category_list -- list of category values we need to retrieve
user_name -- string obtained from getSecurityManager().getUser().getId()
ob -- object which we want to assign roles to
portal_type -- portal type of object
"""
if object is None:
return []
object = object.getParentValue()
if object is None:
return []
return object.ERP5Type_getSecurityCategoryFromRelatedDataAnalysisLine(base_category_list, user_name, object, portal_type)
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>base_category_list, user_name, object, portal_type</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Type_getSecurityCategoryFromParentRelatedDataAnalysisLine</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -12,3 +12,9 @@ for data_analysis_line in data_analysis_lines:
data_analysis_line.activate(after_tag=tag).updateLocalRolesOnSecurityGroups()
for value in data_analysis_line.getAggregateValueList():
value.activate(after_tag=tag).updateLocalRolesOnSecurityGroups()
try:
content_values = value.contentValues()
for content_value in content_values:
content_value.activate(after_tag=tag).updateLocalRolesOnSecurityGroups()
except AttributeError:
pass
......@@ -5,6 +5,7 @@ Data Analysis
Data Analysis Line
Data Analysis Module
Data Array
Data Array Line
Data Array Module
Data Ingestion
Data Ingestion Module
......
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