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 @@
<item>Auditor</item>
<item>Author</item>
</role>
<role id='R-MEMBER'>
<item>Auditor</item>
<item>Author</item>
</role>
<role id='zope'>
<item>Owner</item>
</role>
......
......@@ -4,9 +4,4 @@
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</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>
\ 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):
['G-COMPANY', self.user_id], False)
self.assertRoles(product, 'G-COMPANY', ['Assignor'])
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
\ No newline at end of file
83
\ No newline at end of file
accounting_module
computer_model_module
computer_module
computer_network_module
......
accounting_module
computer_model_module
computer_module
computer_network_module
......
Accounting Transaction
Accounting Transaction Module
Assignment
Balance Transaction
Computer
Computer Model
Computer Model Module
......@@ -22,9 +25,12 @@ Open Sale Order Module
Organisation
Organisation Module
PDF
Payment Transaction
Person
Person Module
Presentation
Purchase Invoice Transaction
Sale Invoice Transaction
Sale Order
Sale Order Module
Sale Packing List
......
Accounting Transaction
Accounting Transaction Module
Assignment
Balance Transaction
Computer
Computer Model
Computer Model Module
......@@ -22,9 +25,12 @@ Open Sale Order Module
Organisation
Organisation Module
PDF
Payment Transaction
Person
Person Module
Presentation
Purchase Invoice Transaction
Sale Invoice Transaction
Sale Order
Sale Order Module
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
\ No newline at end of file
560
\ No newline at end of file
......@@ -10,7 +10,6 @@ account_module/purchase
account_module/receivable
account_module/refundable_vat
account_module/sales
accounting_module
business_process_module
business_process_module/vifib_purchase_business_process
business_process_module/vifib_sale_business_process
......
......@@ -10,7 +10,6 @@ account_module/purchase
account_module/receivable
account_module/refundable_vat
account_module/sales
accounting_module
business_process_module
business_process_module/vifib_purchase_business_process
business_process_module/vifib_sale_business_process
......
Account
Account Module
Accounting Period
Accounting Transaction
Accounting Transaction Module
Acknowledgement
Balance Transaction
Bank Account
Business Process
Business Process Module
......@@ -37,12 +34,10 @@ Meeting Module
Note
Notification Message
Notification Message Module
Payment Transaction
Payzen Event
Phone Call
Product
Product Module
Purchase Invoice Transaction
Purchase Order
Purchase Order Module
Purchase Packing List
......@@ -51,7 +46,6 @@ Purchase Trade Condition
Purchase Trade Condition Module
Query
Query Module
Sale Invoice Transaction
Sale Opportunity
Sale Opportunity Module
Sale Trade Condition
......
Account
Account Module
Accounting Period
Accounting Transaction
Accounting Transaction Module
Acknowledgement
Balance Transaction
Bank Account
Business Process
Business Process Module
......@@ -37,12 +34,10 @@ Meeting Module
Note
Notification Message
Notification Message Module
Payment Transaction
Payzen Event
Phone Call
Product
Product Module
Purchase Invoice Transaction
Purchase Order
Purchase Order Module
Purchase Packing List
......@@ -51,7 +46,6 @@ Purchase Trade Condition
Purchase Trade Condition Module
Query
Query Module
Sale Invoice Transaction
Sale Opportunity
Sale Opportunity Module
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