Commit e4c91327 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_erp5: Allow Administrator access Subscription Request and Instance Response

parent 1f049470
<local_roles_item>
<local_roles>
<role id='G-COMPANY'>
<item>Auditor</item>
<item>Author</item>
</role>
</local_roles>
<local_role_group_ids>
<local_role_group_id id='group'>
<principal id='G-COMPANY'>Auditor</principal>
<principal id='G-COMPANY'>Author</principal>
</local_role_group_id>
</local_role_group_ids>
</local_roles_item>
\ No newline at end of file
<local_roles_item>
<local_roles>
<role id='G-COMPANY'>
<item>Auditor</item>
<item>Author</item>
</role>
</local_roles>
<local_role_group_ids>
<local_role_group_id id='group'>
<principal id='G-COMPANY'>Auditor</principal>
<principal id='G-COMPANY'>Author</principal>
</local_role_group_id>
</local_role_group_ids>
</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
<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
......@@ -1294,6 +1294,44 @@ class TestCampaign(TestSlapOSGroupRoleSecurityMixin):
self.assertRoles(product, 'G-COMPANY', ['Assignor'])
self.assertRoles(product, self.user_id, ['Owner'])
class TestIncidentResponseModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.incident_response_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 TestIncidentResponse(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
incident_response = self.portal.incident_response_module.newContent(
portal_type='Incident Response')
incident_response.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(incident_response,
['G-COMPANY', self.user_id], False)
self.assertRoles(incident_response, 'G-COMPANY', ['Assignor'])
self.assertRoles(incident_response, self.user_id, ['Owner'])
class TestSubscriptionRequestModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.subscription_request_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_request = self.portal.subscription_request_module.newContent(
portal_type='Subscription Request')
subscription_request.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(subscription_request,
['G-COMPANY', self.user_id], False)
self.assertRoles(subscription_request, 'G-COMPANY', ['Assignor'])
self.assertRoles(subscription_request, self.user_id, ['Owner'])
class TestCashRegister(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
product = self.portal.organisation_module.newContent(
......@@ -2290,6 +2328,8 @@ class TestCloudContractModule(TestSlapOSGroupRoleSecurityMixin):
self.assertSecurityGroup(module,
[self.user_id, 'G-COMPANY', 'R-MEMBER', 'R-SHADOW-PERSON'], False)
self.assertRoles(module, 'G-COMPANY', ['Author', 'Auditor'])
self.assertRoles(module, 'R-MEMBER', ['Auditor'])
self.assertRoles(module, 'R-SHADOW-PERSON', ['Auditor'])
self.assertRoles(module, self.user_id, ['Owner'])
class TestCloudContract(TestSlapOSGroupRoleSecurityMixin):
......
......@@ -41,6 +41,7 @@ event_module
event_module/slapos_crm_web_message_template
hosting_subscription_module
image_module
incident_response_module
inventory_module
invitation_token_module
knowledge_pad_module
......@@ -97,6 +98,7 @@ software_installation_module
software_instance_module
software_product_module
software_release_module
subscription_request_module
support_request_module
support_request_module/slapos_crm_support_request_template
system_event_module
......
......@@ -50,6 +50,8 @@ Hosting Subscription
Hosting Subscription Module
Image
Image Module
Incident Response
Incident Response Module
Integration Site
Integration Tool
Inventory
......@@ -114,6 +116,8 @@ Software Product Module
Software Release
Software Release Module
Spreadsheet
Subscription Request
Subscription Request Module
Support Request
Support Request Module
System Event Module
......
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