Commit 30249f8e authored by Romain Courteaud's avatar Romain Courteaud

Migrate accounting module security.

Drop user access for now.
parent a60236d2
...@@ -4,10 +4,6 @@ ...@@ -4,10 +4,6 @@
<item>Auditor</item> <item>Auditor</item>
<item>Author</item> <item>Author</item>
</role> </role>
<role id='R-MEMBER'>
<item>Auditor</item>
<item>Author</item>
</role>
<role id='zope'> <role id='zope'>
<item>Owner</item> <item>Owner</item>
</role> </role>
......
...@@ -4,9 +4,4 @@ ...@@ -4,9 +4,4 @@
<multi_property id='category'>group/company</multi_property> <multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property> <multi_property id='base_category'>group</multi_property>
</role> </role>
<role id='Author; Auditor'>
<property id='title'>Member</property>
<multi_property id='category'>role/member</multi_property>
<multi_property id='base_category'>role</multi_property>
</role>
</type_roles> </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
<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
...@@ -803,3 +803,62 @@ class TestSalePackingList(TestSlapOSGroupRoleSecurityMixin): ...@@ -803,3 +803,62 @@ class TestSalePackingList(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 TestAccountingTransactionModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.accounting_module
self.assertSecurityGroup(module,
['G-COMPANY', 'zope'], True)
self.assertRoles(module, 'G-COMPANY', ['Auditor', 'Author'])
self.assertRoles(module, 'zope', ['Owner'])
class TestAccountingTransaction(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.accounting_module.newContent(
portal_type='Accounting Transaction')
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 TestBalanceTransaction(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.accounting_module.newContent(
portal_type='Balance Transaction')
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 TestPaymentTransaction(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.accounting_module.newContent(
portal_type='Payment Transaction')
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 TestPurchaseInvoiceTransaction(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.accounting_module.newContent(
portal_type='Purchase Invoice Transaction')
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 TestSaleInvoiceTransaction(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.accounting_module.newContent(
portal_type='Sale Invoice Transaction')
product.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(product,
['G-COMPANY', self.user_id], False)
self.assertRoles(product, 'G-COMPANY', ['Assignor'])
self.assertRoles(product, self.user_id, ['Owner'])
82 83
\ No newline at end of file \ No newline at end of file
accounting_module
computer_model_module computer_model_module
computer_module computer_module
computer_network_module computer_network_module
......
accounting_module
computer_model_module computer_model_module
computer_module computer_module
computer_network_module computer_network_module
......
Accounting Transaction
Accounting Transaction Module
Assignment Assignment
Balance Transaction
Computer Computer
Computer Model Computer Model
Computer Model Module Computer Model Module
...@@ -22,9 +25,12 @@ Open Sale Order Module ...@@ -22,9 +25,12 @@ Open Sale Order Module
Organisation Organisation
Organisation Module Organisation Module
PDF PDF
Payment Transaction
Person Person
Person Module Person Module
Presentation Presentation
Purchase Invoice Transaction
Sale Invoice Transaction
Sale Order Sale Order
Sale Order Module Sale Order Module
Sale Packing List Sale Packing List
......
Accounting Transaction
Accounting Transaction Module
Assignment Assignment
Balance Transaction
Computer Computer
Computer Model Computer Model
Computer Model Module Computer Model Module
...@@ -22,9 +25,12 @@ Open Sale Order Module ...@@ -22,9 +25,12 @@ Open Sale Order Module
Organisation Organisation
Organisation Module Organisation Module
PDF PDF
Payment Transaction
Person Person
Person Module Person Module
Presentation Presentation
Purchase Invoice Transaction
Sale Invoice Transaction
Sale Order Sale Order
Sale Order Module Sale Order Module
Sale Packing List Sale Packing List
......
<type_roles>
<role id='Assignor; Assignee'>
<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='Associate'>
<property id='title'>User</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromContent</property>
<multi_property id='base_category'>destination_section</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Auditor'>
<property id='title'>Destination Section is auditor</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
559 560
\ No newline at end of file \ No newline at end of file
...@@ -10,7 +10,6 @@ account_module/purchase ...@@ -10,7 +10,6 @@ account_module/purchase
account_module/receivable account_module/receivable
account_module/refundable_vat account_module/refundable_vat
account_module/sales account_module/sales
accounting_module
business_process_module business_process_module
business_process_module/vifib_purchase_business_process business_process_module/vifib_purchase_business_process
business_process_module/vifib_sale_business_process business_process_module/vifib_sale_business_process
......
...@@ -10,7 +10,6 @@ account_module/purchase ...@@ -10,7 +10,6 @@ account_module/purchase
account_module/receivable account_module/receivable
account_module/refundable_vat account_module/refundable_vat
account_module/sales account_module/sales
accounting_module
business_process_module business_process_module
business_process_module/vifib_purchase_business_process business_process_module/vifib_purchase_business_process
business_process_module/vifib_sale_business_process business_process_module/vifib_sale_business_process
......
Account Account
Account Module Account Module
Accounting Period Accounting Period
Accounting Transaction
Accounting Transaction Module
Acknowledgement Acknowledgement
Balance Transaction
Bank Account Bank Account
Business Process Business Process
Business Process Module Business Process Module
...@@ -37,12 +34,10 @@ Meeting Module ...@@ -37,12 +34,10 @@ Meeting Module
Note Note
Notification Message Notification Message
Notification Message Module Notification Message Module
Payment Transaction
Payzen Event Payzen Event
Phone Call Phone Call
Product Product
Product Module Product Module
Purchase Invoice Transaction
Purchase Order Purchase Order
Purchase Order Module Purchase Order Module
Purchase Packing List Purchase Packing List
...@@ -51,7 +46,6 @@ Purchase Trade Condition ...@@ -51,7 +46,6 @@ Purchase Trade Condition
Purchase Trade Condition Module Purchase Trade Condition Module
Query Query
Query Module Query Module
Sale Invoice Transaction
Sale Opportunity Sale Opportunity
Sale Opportunity Module Sale Opportunity Module
Sale Trade Condition Sale Trade Condition
......
Account Account
Account Module Account Module
Accounting Period Accounting Period
Accounting Transaction
Accounting Transaction Module
Acknowledgement Acknowledgement
Balance Transaction
Bank Account Bank Account
Business Process Business Process
Business Process Module Business Process Module
...@@ -37,12 +34,10 @@ Meeting Module ...@@ -37,12 +34,10 @@ Meeting Module
Note Note
Notification Message Notification Message
Notification Message Module Notification Message Module
Payment Transaction
Payzen Event Payzen Event
Phone Call Phone Call
Product Product
Product Module Product Module
Purchase Invoice Transaction
Purchase Order Purchase Order
Purchase Order Module Purchase Order Module
Purchase Packing List Purchase Packing List
...@@ -51,7 +46,6 @@ Purchase Trade Condition ...@@ -51,7 +46,6 @@ Purchase Trade Condition
Purchase Trade Condition Module Purchase Trade Condition Module
Query Query
Query Module Query Module
Sale Invoice Transaction
Sale Opportunity Sale Opportunity
Sale Opportunity Module Sale Opportunity Module
Sale Trade Condition Sale Trade Condition
......
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