Commit 7db217cc authored by Romain Courteaud's avatar Romain Courteaud

Migrate security configuration.

parent b7335586
<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
...@@ -1181,3 +1181,195 @@ class TestVisit(TestSlapOSGroupRoleSecurityMixin): ...@@ -1181,3 +1181,195 @@ class TestVisit(TestSlapOSGroupRoleSecurityMixin):
['G-COMPANY', self.user_id], False) ['G-COMPANY', self.user_id], False)
self.assertRoles(product, 'G-COMPANY', ['Assignor']) self.assertRoles(product, 'G-COMPANY', ['Assignor'])
self.assertRoles(product, self.user_id, ['Owner']) self.assertRoles(product, self.user_id, ['Owner'])
class TestNotificationMessageModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.notification_message_module
self.assertSecurityGroup(module,
['G-COMPANY', 'zope'], False)
self.assertRoles(module, 'G-COMPANY', ['Auditor', 'Author'])
self.assertRoles(module, 'zope', ['Owner'])
class TestNotificationMessage(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.notification_message_module.newContent(
portal_type='Notification Message')
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 TestProductModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.product_module
self.assertSecurityGroup(module,
['G-COMPANY', 'zope'], True)
self.assertRoles(module, 'G-COMPANY', ['Auditor', 'Author'])
self.assertRoles(module, 'zope', ['Owner'])
class TestProduct(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.product_module.newContent(
portal_type='Product')
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 TestPurchaseOrderModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.purchase_order_module
self.assertSecurityGroup(module,
['G-COMPANY', 'zope'], True)
self.assertRoles(module, 'G-COMPANY', ['Auditor', 'Author'])
self.assertRoles(module, 'zope', ['Owner'])
class TestPurchaseOrder(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.purchase_order_module.newContent(
portal_type='Purchase 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 TestPurchaseTradeConditionModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.purchase_trade_condition_module
self.assertSecurityGroup(module,
['G-COMPANY', 'zope'], True)
self.assertRoles(module, 'G-COMPANY', ['Auditor', 'Author'])
self.assertRoles(module, 'zope', ['Owner'])
class TestPurchaseTradeCondition(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.purchase_trade_condition_module.newContent(
portal_type='Purchase 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'])
class TestQueryModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.query_module
self.assertSecurityGroup(module,
['G-COMPANY', 'zope'], False)
self.assertRoles(module, 'G-COMPANY', ['Auditor', 'Author'])
self.assertRoles(module, 'zope', ['Owner'])
class TestQuery(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.query_module.newContent(
portal_type='Query')
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 TestSaleOpportunityModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.sale_opportunity_module
self.assertSecurityGroup(module,
['G-COMPANY', 'zope'], True)
self.assertRoles(module, 'G-COMPANY', ['Auditor', 'Author'])
self.assertRoles(module, 'zope', ['Owner'])
class TestSaleOpportunity(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.sale_opportunity_module.newContent(
portal_type='Sale Opportunity')
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 TestShortMessage(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.event_module.newContent(
portal_type='Short Message')
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 TestSiteMessage(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.event_module.newContent(
portal_type='Site Message')
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 TestWebMessage(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.event_module.newContent(
portal_type='Web Message')
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 TestSupportRequestModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.support_request_module
self.assertSecurityGroup(module,
['G-COMPANY', 'zope'], True)
self.assertRoles(module, 'G-COMPANY', ['Auditor', 'Author'])
self.assertRoles(module, 'zope', ['Owner'])
class TestSupportRequest(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.support_request_module.newContent(
portal_type='Support Request')
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 TestTransformationModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.transformation_module
self.assertSecurityGroup(module,
['G-COMPANY', 'zope'], True)
self.assertRoles(module, 'G-COMPANY', ['Auditor', 'Author'])
self.assertRoles(module, 'zope', ['Owner'])
class TestTransformation(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.transformation_module.newContent(
portal_type='Transformation')
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 TestWebPageModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.web_page_module
self.assertSecurityGroup(module,
['G-COMPANY', 'zope'], True)
self.assertRoles(module, 'G-COMPANY', ['Auditor', 'Author'])
self.assertRoles(module, 'zope', ['Owner'])
class TestWebPage(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.web_page_module.newContent(
portal_type='Web Page')
product.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(product,
['G-COMPANY', self.user_id], False)
self.assertRoles(product, 'G-COMPANY', ['Assignor'])
self.assertRoles(product, self.user_id, ['Owner'])
117 118
\ No newline at end of file \ No newline at end of file
...@@ -16,11 +16,17 @@ image_module ...@@ -16,11 +16,17 @@ image_module
inventory_module inventory_module
knowledge_pad_module knowledge_pad_module
meeting_module meeting_module
notification_message_module
open_sale_order_module open_sale_order_module
organisation_module organisation_module
person_module person_module
portal_contributions portal_contributions
portal_gadgets portal_gadgets
product_module
purchase_order_module
purchase_trade_condition_module
query_module
sale_opportunity_module
sale_order_module sale_order_module
sale_packing_list_module sale_packing_list_module
sale_trade_condition_module sale_trade_condition_module
...@@ -28,4 +34,7 @@ service_module ...@@ -28,4 +34,7 @@ service_module
software_installation_module software_installation_module
software_instance_module software_instance_module
software_product_module software_product_module
software_release_module software_release_module
\ No newline at end of file support_request_module
transformation_module
web_page_module
\ No newline at end of file
...@@ -16,11 +16,17 @@ image_module ...@@ -16,11 +16,17 @@ image_module
inventory_module inventory_module
knowledge_pad_module knowledge_pad_module
meeting_module meeting_module
notification_message_module
open_sale_order_module open_sale_order_module
organisation_module organisation_module
person_module person_module
portal_contributions portal_contributions
portal_gadgets portal_gadgets
product_module
purchase_order_module
purchase_trade_condition_module
query_module
sale_opportunity_module
sale_order_module sale_order_module
sale_packing_list_module sale_packing_list_module
sale_trade_condition_module sale_trade_condition_module
...@@ -28,4 +34,7 @@ service_module ...@@ -28,4 +34,7 @@ service_module
software_installation_module software_installation_module
software_instance_module software_instance_module
software_product_module software_product_module
software_release_module software_release_module
\ No newline at end of file support_request_module
transformation_module
web_page_module
\ No newline at end of file
...@@ -48,6 +48,8 @@ Mail Message ...@@ -48,6 +48,8 @@ Mail Message
Meeting Meeting
Meeting Module Meeting Module
Note Note
Notification Message
Notification Message Module
Open Sale Order Open Sale Order
Open Sale Order Module Open Sale Order Module
Organisation Organisation
...@@ -58,8 +60,18 @@ Person ...@@ -58,8 +60,18 @@ Person
Person Module Person Module
Phone Call Phone Call
Presentation Presentation
Product
Product Module
Purchase Invoice Transaction Purchase Invoice Transaction
Purchase Order
Purchase Order Module
Purchase Trade Condition
Purchase Trade Condition Module
Query
Query Module
Sale Invoice Transaction Sale Invoice Transaction
Sale Opportunity
Sale Opportunity Module
Sale Order Sale Order
Sale Order Module Sale Order Module
Sale Packing List Sale Packing List
...@@ -68,6 +80,8 @@ Sale Trade Condition ...@@ -68,6 +80,8 @@ Sale Trade Condition
Sale Trade Condition Module Sale Trade Condition Module
Service Service
Service Module Service Module
Short Message
Site Message
Slave Instance Slave Instance
Software Installation Software Installation
Software Installation Module Software Installation Module
...@@ -78,5 +92,12 @@ Software Product Module ...@@ -78,5 +92,12 @@ Software Product Module
Software Release Software Release
Software Release Module Software Release Module
Spreadsheet Spreadsheet
Support Request
Support Request Module
Text Text
Visit Transformation
\ No newline at end of file Transformation Module
Visit
Web Message
Web Page
Web Page Module
\ No newline at end of file
Account Account
Account Module Account Module
Accounting Period Accounting Period
Visit
Accounting Transaction Accounting Transaction
Accounting Transaction Module Accounting Transaction Module
Acknowledgement Acknowledgement
...@@ -49,6 +48,8 @@ Mail Message ...@@ -49,6 +48,8 @@ Mail Message
Meeting Meeting
Meeting Module Meeting Module
Note Note
Notification Message
Notification Message Module
Open Sale Order Open Sale Order
Open Sale Order Module Open Sale Order Module
Organisation Organisation
...@@ -59,8 +60,18 @@ Person ...@@ -59,8 +60,18 @@ Person
Person Module Person Module
Phone Call Phone Call
Presentation Presentation
Product
Product Module
Purchase Invoice Transaction Purchase Invoice Transaction
Purchase Order
Purchase Order Module
Purchase Trade Condition
Purchase Trade Condition Module
Query
Query Module
Sale Invoice Transaction Sale Invoice Transaction
Sale Opportunity
Sale Opportunity Module
Sale Order Sale Order
Sale Order Module Sale Order Module
Sale Packing List Sale Packing List
...@@ -69,6 +80,8 @@ Sale Trade Condition ...@@ -69,6 +80,8 @@ Sale Trade Condition
Sale Trade Condition Module Sale Trade Condition Module
Service Service
Service Module Service Module
Short Message
Site Message
Slave Instance Slave Instance
Software Installation Software Installation
Software Installation Module Software Installation Module
...@@ -79,4 +92,12 @@ Software Product Module ...@@ -79,4 +92,12 @@ Software Product Module
Software Release Software Release
Software Release Module Software Release Module
Spreadsheet Spreadsheet
Text Support Request
\ No newline at end of file Support Request Module
Text
Transformation
Transformation Module
Visit
Web Message
Web Page
Web Page Module
\ No newline at end of file
<type_roles>
<role id='Assignee'>
<property id='title'>Acquired Assignee</property>
<property id='description'>If this query is associated to a document, the Assignee of the query is the Assignee of the document it is related to.</property>
<property id='base_category_script'>ERP5Type_acquireSecurityFromCategory</property>
<multi_property id='base_category'>agent</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>
</type_roles>
\ No newline at end of file
590 591
\ No newline at end of file \ No newline at end of file
notification_message_module
portal_integrations portal_integrations
portal_integrations/slapos_payzen_test_integration portal_integrations/slapos_payzen_test_integration
product_module
purchase_order_module
purchase_trade_condition_module
query_module
sale_opportunity_module
support_request_module
system_event_module system_event_module
tax_module tax_module
transformation_module \ No newline at end of file
web_page_module
\ No newline at end of file
notification_message_module
portal_integrations portal_integrations
portal_integrations/slapos_payzen_test_integration portal_integrations/slapos_payzen_test_integration
product_module
purchase_order_module
purchase_trade_condition_module
query_module
sale_opportunity_module
support_request_module
system_event_module system_event_module
tax_module tax_module
transformation_module \ No newline at end of file
web_page_module
\ No newline at end of file
...@@ -2,28 +2,7 @@ Business Process ...@@ -2,28 +2,7 @@ Business Process
Business Process Module Business Process Module
Integration Site Integration Site
Integration Tool Integration Tool
Notification Message
Notification Message Module
Payzen Event Payzen Event
Product
Product Module
Purchase Order
Purchase Order Module
Purchase Trade Condition
Purchase Trade Condition Module
Query
Query Module
Sale Opportunity
Sale Opportunity Module
Short Message
Site Message
Support Request
Support Request Module
System Event Module System Event Module
Tax Tax
Tax Module Tax Module
Transformation \ No newline at end of file
Transformation Module
Web Message
Web Page
Web Page Module
\ No newline at end of file
Integration Site
Business Process Business Process
Business Process Module Business Process Module
Integration Site
Integration Tool Integration Tool
Notification Message
Notification Message Module
Payzen Event Payzen Event
Product
Product Module
Purchase Order
Purchase Order Module
Purchase Trade Condition
Purchase Trade Condition Module
Query
Query Module
Sale Opportunity
Sale Opportunity Module
Short Message
Site Message
Support Request
Support Request Module
System Event Module System Event Module
Tax Tax
Tax Module Tax Module
Transformation \ No newline at end of file
Transformation Module
Web Message
Web Page
Web Page Module
\ No newline at end of file
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