Commit 33bd5105 authored by Romain Courteaud's avatar Romain Courteaud

slapos_erp5: update Subscription Request local roles

parent 6c6bd9d3
......@@ -2,10 +2,6 @@
<local_roles>
<role id='F-CUSTOMER'>
<item>Auditor</item>
<item>Author</item>
</role>
<role id='F-PRODUCTION*'>
<item>Auditor</item>
</role>
<role id='F-SALE*'>
<item>Auditor</item>
......@@ -15,8 +11,6 @@
<local_role_group_ids>
<local_role_group_id id='function'>
<principal id='F-CUSTOMER'>Auditor</principal>
<principal id='F-CUSTOMER'>Author</principal>
<principal id='F-PRODUCTION*'>Auditor</principal>
<principal id='F-SALE*'>Auditor</principal>
<principal id='F-SALE*'>Author</principal>
</local_role_group_id>
......
<type_roles>
<role id='Author; Auditor'>
<role id='Auditor'>
<property id='title'>Member</property>
<multi_property id='categories'>local_role_group/function</multi_property>
<multi_property id='category'>function/customer</multi_property>
<multi_property id='base_category'>function</multi_property>
</role>
<role id='Auditor'>
<property id='title'>Production</property>
<multi_property id='categories'>local_role_group/function</multi_property>
<multi_property id='category'>function/production*</multi_property>
<multi_property id='base_category'>function</multi_property>
</role>
<role id='Author; Auditor'>
<role id='Auditor; Author'>
<property id='title'>Sale</property>
<multi_property id='categories'>local_role_group/function</multi_property>
<multi_property id='category'>function/sale*</multi_property>
......
......@@ -10,13 +10,7 @@
<role id='Auditor'>
<property id='title'>Sale Agent</property>
<multi_property id='categories'>local_role_group/function</multi_property>
<multi_property id='category'>function/sale/agent</multi_property>
<multi_property id='base_category'>function</multi_property>
</role>
<role id='Auditor'>
<property id='title'>Sale Manager</property>
<multi_property id='categories'>local_role_group/function</multi_property>
<multi_property id='category'>function/sale/manager</multi_property>
<multi_property id='category'>function/sale*</multi_property>
<multi_property id='base_category'>function</multi_property>
</role>
</type_roles>
\ No newline at end of file
......@@ -1560,3 +1560,36 @@ class TestSaleTradeCondition(TestSlapOSGroupRoleSecurityMixin):
self.assertRoles(delivery, 'F-ACCOUNTING*', ['Auditor'])
self.assertRoles(delivery, 'R-SHADOW-PERSON', ['Auditor'])
class TestSubscriptionRequestModule(TestSlapOSGroupRoleSecurityMixin):
def test_SubscriptionRequestModule(self):
module = self.portal.subscription_request_module
self.assertSecurityGroup(module,
['F-SALE*', 'F-CUSTOMER', module.Base_getOwnerId()], False)
self.assertRoles(module, 'F-SALE*', ['Auditor', 'Author'])
self.assertRoles(module, 'F-CUSTOMER', ['Auditor'])
self.assertRoles(module, module.Base_getOwnerId(), ['Owner'])
class TestSubscriptionRequest(TestSlapOSGroupRoleSecurityMixin):
def test_SubscriptionRequest_default(self):
delivery = self.portal.subscription_request_module.newContent(
portal_type='Subscription Request')
self.assertSecurityGroup(delivery,
['F-SALE*', self.user_id], False)
self.assertRoles(delivery, self.user_id, ['Owner'])
self.assertRoles(delivery, 'F-SALE*', ['Auditor'])
def test_SubscriptionRequest_user(self):
reference = 'TESTPERSON-%s' % self.generateNewId()
person = self.portal.person_module.newContent(portal_type='Person',
reference=reference)
delivery = self.portal.subscription_request_module.newContent(
portal_type='Subscription Request')
delivery.edit(destination_decision_value=person, ledger="automated")
self.assertSecurityGroup(delivery,
['F-SALE*', self.user_id, person.getUserId()], False)
self.assertRoles(delivery, self.user_id, ['Owner'])
self.assertRoles(delivery, 'F-SALE*', ['Auditor'])
self.assertRoles(delivery, person.getUserId(), ['Associate'])
......@@ -56,7 +56,8 @@
<key> <string>trigger_method_id</string> </key>
<value>
<tuple>
<string>_setSource.*</string>
<string>_setDestinationDecision.*</string>
<string>_setLedger.*</string>
</tuple>
</value>
</item>
......
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