Commit 5bd73a38 authored by Romain Courteaud's avatar Romain Courteaud

Migrate Sale Order/Packing List security configuration.

parent a6a3fce1
......@@ -4,17 +4,6 @@
<item>Auditor</item>
<item>Author</item>
</role>
<role id='R-COMPUTER'>
<item>Auditor</item>
</role>
<role id='R-INSTANCE'>
<item>Auditor</item>
<item>Author</item>
</role>
<role id='R-MEMBER'>
<item>Auditor</item>
<item>Author</item>
</role>
<role id='admin'>
<item>Owner</item>
</role>
......
......@@ -4,18 +4,6 @@
<item>Auditor</item>
<item>Author</item>
</role>
<role id='R-COMPUTER'>
<item>Auditor</item>
<item>Author</item>
</role>
<role id='R-INSTANCE'>
<item>Auditor</item>
<item>Author</item>
</role>
<role id='R-MEMBER'>
<item>Auditor</item>
<item>Author</item>
</role>
<role id='admin'>
<item>Owner</item>
</role>
......
<type_roles>
<role id='Author; Auditor'>
<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
<type_roles>
<role id='Assignee'>
<property id='title'>Destination Decision</property>
<property id='description'>Monovalued role</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromContent</property>
<multi_property id='base_category'>destination_decision</multi_property>
</role>
<role id='Assignor'>
<property id='title'>Group company</property>
<multi_property id='category'>group/company</multi_property>
......
<type_roles>
<role id='Author; Auditor'>
<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
<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
......@@ -768,3 +768,38 @@ class TestOpenSaleOrder(TestSlapOSGroupRoleSecurityMixin):
self.assertRoles(product, 'G-COMPANY', ['Assignor'])
self.assertRoles(product, self.user_id, ['Owner'])
class TestSaleOrderModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.sale_order_module
self.assertSecurityGroup(module,
['G-COMPANY', 'admin'], True)
self.assertRoles(module, 'G-COMPANY', ['Auditor', 'Author'])
self.assertRoles(module, 'admin', ['Owner'])
class TestSaleOrder(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.sale_order_module.newContent(
portal_type='Sale Order')
product.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(product,
['G-COMPANY', self.user_id], False)
self.assertRoles(product, 'G-COMPANY', ['Assignor'])
self.assertRoles(product, self.user_id, ['Owner'])
class TestSalePackingListModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.sale_packing_list_module
self.assertSecurityGroup(module,
['G-COMPANY', 'admin'], False)
self.assertRoles(module, 'G-COMPANY', ['Auditor', 'Author'])
self.assertRoles(module, 'admin', ['Owner'])
class TestSalePackingList(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.sale_packing_list_module.newContent(
portal_type='Sale Packing List')
product.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(product,
['G-COMPANY', self.user_id], False)
self.assertRoles(product, 'G-COMPANY', ['Assignor'])
self.assertRoles(product, self.user_id, ['Owner'])
79
\ No newline at end of file
80
\ No newline at end of file
......@@ -10,6 +10,8 @@ open_sale_order_module
organisation_module
person_module
portal_contributions
sale_order_module
sale_packing_list_module
software_installation_module
software_instance_module
software_product_module
......
open_sale_order_module
computer_model_module
computer_module
computer_network_module
......@@ -7,7 +6,10 @@ data_set_module
document_module
hosting_subscription_module
image_module
open_sale_order_module
organisation_module
sale_order_module
sale_packing_list_module
person_module
portal_contributions
software_installation_module
......
......@@ -24,6 +24,10 @@ PDF
Person
Person Module
Presentation
Sale Order
Sale Order Module
Sale Packing List
Sale Packing List Module
Slave Instance
Software Installation
Software Installation Module
......
Open Sale Order
Open Sale Order Module
Assignment
Sale Order
Sale Order Module
Sale Packing List
Sale Packing List Module
Computer
Computer Model
Computer Model Module
......@@ -18,6 +20,8 @@ Hosting Subscription
Hosting Subscription Module
Image
Image Module
Open Sale Order
Open Sale Order Module
Organisation
Organisation Module
PDF
......
<type_roles>
<role id='Auditor'>
<property id='title'>Computer</property>
<multi_property id='category'>role/computer</multi_property>
<multi_property id='base_category'>role</multi_property>
</role>
<role id='Author; Auditor'>
<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; Author'>
<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='Auditor; Author'>
<property id='title'>Computer</property>
<multi_property id='category'>role/computer</multi_property>
<multi_property id='base_category'>role</multi_property>
</role>
<role id='Author; Auditor'>
<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; Author'>
<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='Assignee'>
<property id='title'>Destination Decision</property>
<property id='description'>Monovalued role</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromContent</property>
<multi_property id='base_category'>destination_decision</multi_property>
</role>
<role id='Auditor'>
<property id='title'>Destination Section</property>
<property id='description'>Monovalued role</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromContent</property>
<multi_property id='base_category'>destination_section</multi_property>
</role>
<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
556
\ No newline at end of file
557
\ No newline at end of file
......@@ -55,8 +55,6 @@ purchase_packing_list_module
purchase_trade_condition_module
query_module
sale_opportunity_module
sale_order_module
sale_packing_list_module
sale_trade_condition_module
sale_trade_condition_module/vifib_trade_condition
service_module
......
......@@ -55,8 +55,6 @@ purchase_packing_list_module
purchase_trade_condition_module
query_module
sale_opportunity_module
sale_order_module
sale_packing_list_module
sale_trade_condition_module
sale_trade_condition_module/vifib_trade_condition
service_module
......
......@@ -55,10 +55,6 @@ Query Module
Sale Invoice Transaction
Sale Opportunity
Sale Opportunity Module
Sale Order
Sale Order Module
Sale Packing List
Sale Packing List Module
Sale Trade Condition
Sale Trade Condition Module
Service
......
......@@ -55,10 +55,6 @@ Query Module
Sale Invoice Transaction
Sale Opportunity
Sale Opportunity Module
Sale Order
Sale Order Module
Sale Packing List
Sale Packing List Module
Sale Trade Condition
Sale Trade Condition Module
Service
......
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