Commit 73c3dec3 authored by Romain Courteaud's avatar Romain Courteaud

slapos_erp5: Sale people can see Compute Node

parent 961eb109
......@@ -26,6 +26,12 @@
<multi_property id='category'>function/production/manager</multi_property>
<multi_property id='base_category'>follow_up</multi_property>
</role>
<role id='Auditor'>
<property id='title'>Sale</property>
<multi_property id='categories'>local_role_group/function</multi_property>
<multi_property id='category'>function/sale*</multi_property>
<multi_property id='base_category'>function</multi_property>
</role>
<role id='Assignor'>
<property id='title'>Self Compute Node</property>
<property id='condition'>python: context.getUserId("") != ""</property>
......
......@@ -414,14 +414,16 @@ class TestComputeNode(TestSlapOSGroupRoleSecurityMixin):
def test_ComputeNode_userId(self):
compute_node = self.portal.compute_node_module.newContent(portal_type='Compute Node')
self.assertSecurityGroup(compute_node,
[self.user_id, compute_node.getUserId()], False)
[self.user_id, compute_node.getUserId(), 'F-SALE*'], False)
self.assertRoles(compute_node, self.user_id, ['Owner'])
self.assertRoles(compute_node, compute_node.getUserId(), ['Assignor'])
self.assertRoles(compute_node, 'F-SALE*', ['Auditor'])
compute_node.edit(user_id=None)
self.assertSecurityGroup(compute_node,
[self.user_id], False)
[self.user_id, 'F-SALE*'], False)
self.assertRoles(compute_node, self.user_id, ['Owner'])
self.assertRoles(compute_node, 'F-SALE*', ['Auditor'])
def test_ComputeNode_ProjectMember(self):
project = self.addProject()
......@@ -437,6 +439,7 @@ class TestComputeNode(TestSlapOSGroupRoleSecurityMixin):
'%s_F-PRODMAN' % project.getReference(),
'%s_F-CUSTOMER' % project.getReference(),
'%s_R-INSTANCE' % project.getReference(),
'F-SALE*',
], False)
self.assertRoles(compute_node, self.user_id, ['Owner'])
self.assertRoles(compute_node, compute_node.getUserId(), ['Assignor'])
......@@ -444,6 +447,7 @@ class TestComputeNode(TestSlapOSGroupRoleSecurityMixin):
self.assertRoles(compute_node, '%s_F-PRODMAN' % project.getReference(), ['Assignor'])
self.assertRoles(compute_node, '%s_F-CUSTOMER' % project.getReference(), ['Auditor'])
self.assertRoles(compute_node, '%s_R-INSTANCE' % project.getReference(), ['Auditor'])
self.assertRoles(compute_node, 'F-SALE*', ['Auditor'])
class TestInstanceNode(TestSlapOSGroupRoleSecurityMixin):
......
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