Commit e9e11516 authored by Romain Courteaud's avatar Romain Courteaud

Give user access to his aggregated PL.

parent 38ec3fb3
......@@ -6,7 +6,7 @@
</role>
<role id='Auditor'>
<property id='title'>Subscription Customer</property>
<property id='condition'>python: here.getSpecialise() == 'sale_trade_condition_module/slapos_subscription_trade_condition'</property>
<property id='condition'>python: here.getSpecialise() in ('sale_trade_condition_module/slapos_subscription_trade_condition', 'sale_trade_condition_module/slapos_aggregated_trade_condition')</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromContent</property>
<multi_property id='base_category'>destination_decision</multi_property>
</role>
......
......@@ -847,6 +847,23 @@ class TestSalePackingList(TestSlapOSGroupRoleSecurityMixin):
self.assertRoles(product, self.user_id, ['Owner'])
self.assertRoles(product, reference, ['Auditor'])
def test_GroupCustomerAggregation(self):
reference = 'TESTPERSON-%s' % self.generateNewId()
person = self.portal.person_module.newContent(portal_type='Person',
reference=reference)
product = self.portal.sale_packing_list_module.newContent(
portal_type='Sale Packing List',
destination_decision_value=person,
specialise_value=self.portal.sale_trade_condition_module.\
slapos_aggregated_trade_condition,
)
product.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(product,
['G-COMPANY', self.user_id, reference], False)
self.assertRoles(product, 'G-COMPANY', ['Assignor'])
self.assertRoles(product, self.user_id, ['Owner'])
self.assertRoles(product, reference, ['Auditor'])
class TestAccountingTransactionModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.accounting_module
......
161
\ No newline at end of file
162
\ 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