Commit 3b7e4ac6 authored by Romain Courteaud's avatar Romain Courteaud

Migrate security configuration.

parent 17f15544
...@@ -932,3 +932,252 @@ class TestSaleTradeCondition(TestSlapOSGroupRoleSecurityMixin): ...@@ -932,3 +932,252 @@ class TestSaleTradeCondition(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 TestAccountingPeriod(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.organisation_module.newContent(
portal_type='Organisation').newContent(
portal_type='Accounting Period')
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 TestAcknowledgement(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.event_module.newContent(
portal_type='Acknowledgement')
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 TestBankAccount(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.organisation_module.newContent(
portal_type='Organisation').newContent(
portal_type='Bank Account')
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 TestCampaignModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.campaign_module
self.assertSecurityGroup(module,
['G-COMPANY', 'zope'], True)
self.assertRoles(module, 'G-COMPANY', ['Auditor', 'Author'])
self.assertRoles(module, 'zope', ['Owner'])
class TestCampaign(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.campaign_module.newContent(
portal_type='Campaign')
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 TestCashRegister(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.organisation_module.newContent(
portal_type='Organisation').newContent(
portal_type='Cash Register')
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 TestComponentModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.component_module
self.assertSecurityGroup(module,
['G-COMPANY', 'zope'], True)
self.assertRoles(module, 'G-COMPANY', ['Auditor', 'Author'])
self.assertRoles(module, 'zope', ['Owner'])
class TestComponent(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.component_module.newContent(
portal_type='Component')
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 TestCreditCard(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.organisation_module.newContent(
portal_type='Organisation').newContent(
portal_type='Credit Card')
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 TestDocumentIngestionModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.document_ingestion_module
self.assertSecurityGroup(module,
['G-COMPANY', 'zope'], True)
self.assertRoles(module, 'G-COMPANY', ['Auditor', 'Author'])
self.assertRoles(module, 'zope', ['Owner'])
class TestEventModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.event_module
self.assertSecurityGroup(module,
['G-COMPANY', 'zope'], True)
self.assertRoles(module, 'G-COMPANY', ['Auditor', 'Author'])
self.assertRoles(module, 'zope', ['Owner'])
class TestFaxMessage(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.event_module.newContent(
portal_type='Fax 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 TestGadget(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.portal_gadgets.newContent(
portal_type='Gadget')
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 TestGadgetTool(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.portal_gadgets
self.assertSecurityGroup(module,
['G-COMPANY', 'zope'], True)
self.assertRoles(module, 'G-COMPANY', ['Auditor', 'Author'])
self.assertRoles(module, 'zope', ['Owner'])
class TestInventory(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.inventory_module.newContent(
portal_type='Inventory')
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 TestInventoryModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.inventory_module
self.assertSecurityGroup(module,
['G-COMPANY', 'zope'], False)
self.assertRoles(module, 'G-COMPANY', ['Auditor', 'Author'])
self.assertRoles(module, 'zope', ['Owner'])
class TestKnowledgeBox(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.knowledge_pad_module.newContent(
portal_type='Knowledge Pad').newContent(
portal_type='Knowledge Box')
product.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(product,
['G-COMPANY', self.user_id], True)
self.assertRoles(product, 'G-COMPANY', ['Assignor'])
self.assertRoles(product, self.user_id, ['Owner'])
class TestKnowledgePad(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.knowledge_pad_module.newContent(
portal_type='Knowledge Pad')
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 TestKnowledgePadModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.knowledge_pad_module
self.assertSecurityGroup(module,
['G-COMPANY', 'zope'], False)
self.assertRoles(module, 'G-COMPANY', ['Auditor', 'Author'])
self.assertRoles(module, 'zope', ['Owner'])
class TestLetter(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.event_module.newContent(
portal_type='Letter')
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 TestMailMessage(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.event_module.newContent(
portal_type='Mail 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 TestMeeting(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.meeting_module.newContent(
portal_type='Meeting')
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 TestMeetingModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.meeting_module
self.assertSecurityGroup(module,
['G-COMPANY', 'zope'], True)
self.assertRoles(module, 'G-COMPANY', ['Auditor', 'Author'])
self.assertRoles(module, 'zope', ['Owner'])
class TestNote(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.event_module.newContent(
portal_type='Note')
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 TestPhoneCall(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.event_module.newContent(
portal_type='Phone Call')
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 TestVisit(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.event_module.newContent(
portal_type='Visit')
product.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(product,
['G-COMPANY', self.user_id], False)
self.assertRoles(product, 'G-COMPANY', ['Assignor'])
self.assertRoles(product, self.user_id, ['Owner'])
116 117
\ No newline at end of file \ No newline at end of file
account_module account_module
accounting_module accounting_module
campaign_module
component_module
computer_model_module computer_model_module
computer_module computer_module
computer_network_module computer_network_module
credential_update_module credential_update_module
currency_module currency_module
data_set_module data_set_module
document_ingestion_module
document_module document_module
event_module
hosting_subscription_module hosting_subscription_module
image_module image_module
inventory_module
knowledge_pad_module
meeting_module
open_sale_order_module open_sale_order_module
organisation_module organisation_module
person_module person_module
portal_contributions portal_contributions
portal_gadgets
sale_order_module sale_order_module
sale_packing_list_module sale_packing_list_module
sale_trade_condition_module sale_trade_condition_module
......
account_module account_module
accounting_module accounting_module
campaign_module
component_module
computer_model_module computer_model_module
computer_module computer_module
computer_network_module computer_network_module
credential_update_module credential_update_module
currency_module currency_module
data_set_module data_set_module
document_ingestion_module
document_module document_module
event_module
hosting_subscription_module hosting_subscription_module
image_module image_module
inventory_module
knowledge_pad_module
meeting_module
open_sale_order_module open_sale_order_module
organisation_module organisation_module
person_module person_module
portal_contributions portal_contributions
portal_gadgets
sale_order_module sale_order_module
sale_packing_list_module sale_packing_list_module
sale_trade_condition_module sale_trade_condition_module
......
Account Account
Account Module Account Module
Accounting Period
Accounting Transaction Accounting Transaction
Accounting Transaction Module Accounting Transaction Module
Acknowledgement
Assignment Assignment
Balance Transaction Balance Transaction
Bank Account
Campaign
Campaign Module
Cash Register
Component
Component Module
Computer Computer
Computer Model Computer Model
Computer Model Module Computer Model Module
...@@ -13,17 +21,33 @@ Computer Network Module ...@@ -13,17 +21,33 @@ Computer Network Module
Computer Partition Computer Partition
Contribution Tool Contribution Tool
Credential Update Module Credential Update Module
Credit Card
Currency Currency
Currency Module Currency Module
Data Set Data Set
Data Set Module Data Set Module
Document Ingestion Module
Document Module Document Module
Drawing Drawing
Event Module
Fax Message
File File
Gadget
Gadget Tool
Hosting Subscription Hosting Subscription
Hosting Subscription Module Hosting Subscription Module
Image Image
Image Module Image Module
Inventory
Inventory Module
Knowledge Box
Knowledge Pad
Knowledge Pad Module
Letter
Mail Message
Meeting
Meeting Module
Note
Open Sale Order Open Sale Order
Open Sale Order Module Open Sale Order Module
Organisation Organisation
...@@ -32,6 +56,7 @@ PDF ...@@ -32,6 +56,7 @@ PDF
Payment Transaction Payment Transaction
Person Person
Person Module Person Module
Phone Call
Presentation Presentation
Purchase Invoice Transaction Purchase Invoice Transaction
Sale Invoice Transaction Sale Invoice Transaction
...@@ -54,3 +79,4 @@ Software Release ...@@ -54,3 +79,4 @@ Software Release
Software Release Module Software Release Module
Spreadsheet Spreadsheet
Text Text
Visit
\ No newline at end of file
Account Account
Account Module Account Module
Accounting Period
Visit
Accounting Transaction Accounting Transaction
Accounting Transaction Module Accounting Transaction Module
Acknowledgement
Assignment Assignment
Balance Transaction Balance Transaction
Bank Account
Campaign
Campaign Module
Cash Register
Component
Component Module
Computer Computer
Computer Model Computer Model
Computer Model Module Computer Model Module
...@@ -13,17 +22,33 @@ Computer Network Module ...@@ -13,17 +22,33 @@ Computer Network Module
Computer Partition Computer Partition
Contribution Tool Contribution Tool
Credential Update Module Credential Update Module
Credit Card
Currency Currency
Currency Module Currency Module
Data Set Data Set
Data Set Module Data Set Module
Document Ingestion Module
Document Module Document Module
Drawing Drawing
Event Module
Fax Message
File File
Gadget
Gadget Tool
Hosting Subscription Hosting Subscription
Hosting Subscription Module Hosting Subscription Module
Image Image
Image Module Image Module
Inventory
Inventory Module
Knowledge Box
Knowledge Pad
Knowledge Pad Module
Letter
Mail Message
Meeting
Meeting Module
Note
Open Sale Order Open Sale Order
Open Sale Order Module Open Sale Order Module
Organisation Organisation
...@@ -32,6 +57,7 @@ PDF ...@@ -32,6 +57,7 @@ PDF
Payment Transaction Payment Transaction
Person Person
Person Module Person Module
Phone Call
Presentation Presentation
Purchase Invoice Transaction Purchase Invoice Transaction
Sale Invoice Transaction Sale Invoice Transaction
......
589 590
\ No newline at end of file \ No newline at end of file
campaign_module
component_module
document_ingestion_module
event_module
inventory_module
knowledge_pad_module
meeting_module
notification_message_module notification_message_module
portal_gadgets
portal_integrations portal_integrations
portal_integrations/slapos_payzen_test_integration portal_integrations/slapos_payzen_test_integration
product_module product_module
......
campaign_module
component_module
document_ingestion_module
event_module
inventory_module
knowledge_pad_module
meeting_module
notification_message_module notification_message_module
portal_gadgets
portal_integrations portal_integrations
portal_integrations/slapos_payzen_test_integration portal_integrations/slapos_payzen_test_integration
product_module product_module
......
Accounting Period
Acknowledgement
Bank Account
Business Process Business Process
Business Process Module Business Process Module
Campaign
Campaign Module
Cash Register
Component
Component Module
Credit Card
Document Ingestion Module
Event Module
Fax Message
Gadget
Gadget Tool
Integration Site Integration Site
Integration Tool Integration Tool
Inventory
Inventory Module
Knowledge Box
Knowledge Pad
Knowledge Pad Module
Letter
Mail Message
Meeting
Meeting Module
Note
Notification Message Notification Message
Notification Message Module Notification Message Module
Payzen Event Payzen Event
Phone Call
Product Product
Product Module Product Module
Purchase Order Purchase Order
...@@ -49,7 +24,6 @@ Tax ...@@ -49,7 +24,6 @@ Tax
Tax Module Tax Module
Transformation Transformation
Transformation Module Transformation Module
Visit
Web Message Web Message
Web Page Web Page
Web Page Module Web Page Module
\ No newline at end of file
Accounting Period Integration Site
Acknowledgement
Bank Account
Business Process Business Process
Business Process Module Business Process Module
Campaign
Campaign Module
Cash Register
Component
Component Module
Credit Card
Document Ingestion Module
Event Module
Fax Message
Gadget
Gadget Tool
Integration Site
Integration Tool Integration Tool
Inventory
Inventory Module
Knowledge Box
Knowledge Pad
Knowledge Pad Module
Letter
Mail Message
Meeting
Meeting Module
Note
Notification Message Notification Message
Notification Message Module Notification Message Module
Payzen Event Payzen Event
Phone Call
Product Product
Product Module Product Module
Purchase Order Purchase Order
...@@ -49,7 +24,6 @@ Tax ...@@ -49,7 +24,6 @@ Tax
Tax Module Tax Module
Transformation Transformation
Transformation Module Transformation Module
Visit
Web Message Web Message
Web Page Web Page
Web Page Module 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