Commit 126bb776 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_erp5: Add security for Subscription Condition

  Same as Subscription Requests
parent e2cebc0c
Pipeline #18423 failed with stage
in 0 seconds
<local_roles_item>
<local_roles>
</local_roles>
</local_roles_item>
\ No newline at end of file
<type_roles>
<role id='Auditor; Author'>
<property id='title'>Company group</property>
<multi_property id='categories'>local_role_group/group</multi_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'>Company group</property>
<multi_property id='categories'>local_role_group/group</multi_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
......@@ -1712,6 +1712,25 @@ class TestSubscriptionRequest(TestSlapOSGroupRoleSecurityMixin):
self.assertRoles(subscription_request, 'G-COMPANY', ['Assignor'])
self.assertRoles(subscription_request, self.user_id, ['Owner'])
class TestSubscriptionConditionModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.subscription_condition_module
self.changeOwnership(module)
self.assertSecurityGroup(module,
['G-COMPANY', self.user_id], False)
self.assertRoles(module, 'G-COMPANY', ['Auditor', 'Author'])
self.assertRoles(module, self.user_id, ['Owner'])
class TestSubscriptionRequest(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
subscription_condition = self.portal.subscription_condition_module.newContent(
portal_type='Subscription Condition')
subscription_condition.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(subscription_condition,
['G-COMPANY', self.user_id], False)
self.assertRoles(subscription_condition, 'G-COMPANY', ['Assignor'])
self.assertRoles(subscription_condition, self.user_id, ['Owner'])
class TestCashRegister(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.organisation_module.newContent(
......
......@@ -110,6 +110,7 @@ software_installation_module
software_instance_module
software_product_module
software_release_module
subscription_condition_module
subscription_request_module
support_request_module
support_request_module/slapos_crm_support_request_template
......
......@@ -117,6 +117,8 @@ Software Product Module
Software Release
Software Release Module
Spreadsheet
Subscription Condition
Subscription Condition Module
Subscription Request
Subscription Request Module
Support Request
......
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