Commit 6ed80d3a authored by Romain Courteaud's avatar Romain Courteaud

Migrate sale trade condition security.

parent 67d84e86
......@@ -4,13 +4,6 @@
<item>Auditor</item>
<item>Author</item>
</role>
<role id='R-INSTANCE'>
<item>Auditor</item>
</role>
<role id='R-MEMBER'>
<item>Auditor</item>
<item>Author</item>
</role>
<role id='admin'>
<item>Owner</item>
</role>
......
......@@ -4,14 +4,4 @@
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
<role id='Auditor'>
<property id='title'>Instance</property>
<multi_property id='category'>role/instance</multi_property>
<multi_property id='base_category'>role</multi_property>
</role>
<role id='Auditor; Author'>
<property id='title'>Member</property>
<multi_property id='category'>role/member</multi_property>
<multi_property id='base_category'>role</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Assignor'>
<property id='title'>Group company</property>
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
</type_roles>
\ No newline at end of file
......@@ -915,3 +915,21 @@ class TestCurrency(TestSlapOSGroupRoleSecurityMixin):
['G-COMPANY', self.user_id], False)
self.assertRoles(product, 'G-COMPANY', ['Assignor'])
self.assertRoles(product, self.user_id, ['Owner'])
class TestSaleTradeConditionModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.sale_trade_condition_module
self.assertSecurityGroup(module,
['G-COMPANY', 'admin'], False)
self.assertRoles(module, 'G-COMPANY', ['Auditor', 'Author'])
self.assertRoles(module, 'admin', ['Owner'])
class TestSaleTradeCondition(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.sale_trade_condition_module.newContent(
portal_type='Sale Trade Condition')
product.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(product,
['G-COMPANY', self.user_id], False)
self.assertRoles(product, 'G-COMPANY', ['Assignor'])
self.assertRoles(product, self.user_id, ['Owner'])
86
\ No newline at end of file
87
\ No newline at end of file
......@@ -15,6 +15,7 @@ person_module
portal_contributions
sale_order_module
sale_packing_list_module
sale_trade_condition_module
service_module
software_installation_module
software_instance_module
......
......@@ -15,6 +15,7 @@ person_module
portal_contributions
sale_order_module
sale_packing_list_module
sale_trade_condition_module
service_module
software_installation_module
software_instance_module
......
......@@ -39,6 +39,8 @@ Sale Order
Sale Order Module
Sale Packing List
Sale Packing List Module
Sale Trade Condition
Sale Trade Condition Module
Service
Service Module
Slave Instance
......
......@@ -39,6 +39,8 @@ Sale Order
Sale Order Module
Sale Packing List
Sale Packing List Module
Sale Trade Condition
Sale Trade Condition Module
Service
Service Module
Slave Instance
......
<type_roles>
<role id='Assignor'>
<property id='title'>Group company</property>
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
<role id='Auditor'>
<property id='title'>Instance</property>
<multi_property id='category'>role/instance</multi_property>
<multi_property id='base_category'>role</multi_property>
</role>
<role id='Auditor'>
<property id='title'>Member</property>
<multi_property id='category'>role/member</multi_property>
<multi_property id='base_category'>role</multi_property>
</role>
<role id='Assignor'>
<property id='title'>Provider of the trade condition</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromContent</property>
<multi_property id='base_category'>source_section</multi_property>
</role>
</type_roles>
\ No newline at end of file
563
\ No newline at end of file
564
\ No newline at end of file
......@@ -51,7 +51,6 @@ purchase_packing_list_module
purchase_trade_condition_module
query_module
sale_opportunity_module
sale_trade_condition_module
sale_trade_condition_module/vifib_trade_condition
service_module/computer_registration
service_module/vifib_discount
......
......@@ -51,7 +51,6 @@ purchase_packing_list_module
purchase_trade_condition_module
query_module
sale_opportunity_module
sale_trade_condition_module
sale_trade_condition_module/vifib_trade_condition
service_module/computer_registration
service_module/vifib_discount
......
......@@ -44,8 +44,6 @@ Query
Query Module
Sale Opportunity
Sale Opportunity Module
Sale Trade Condition
Sale Trade Condition Module
Short Message
Site Message
Support Request
......
......@@ -44,8 +44,6 @@ Query
Query Module
Sale Opportunity
Sale Opportunity Module
Sale Trade Condition
Sale Trade Condition Module
Short Message
Site Message
Support Request
......
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