Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Carlos Ramos Carreño
slapos.core
Commits
0c22127e
Commit
0c22127e
authored
Aug 23, 2024
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_erp5: Sale people can see Compute Node
parent
f7b00a8c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Compute%20Node.xml
...lapos_erp5/PortalTypeRolesTemplateItem/Compute%20Node.xml
+6
-0
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
...l_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
+6
-2
No files found.
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Compute%20Node.xml
View file @
0c22127e
...
@@ -26,6 +26,12 @@
...
@@ -26,6 +26,12 @@
<multi_property
id=
'category'
>
function/production/manager
</multi_property>
<multi_property
id=
'category'
>
function/production/manager
</multi_property>
<multi_property
id=
'base_category'
>
follow_up
</multi_property>
<multi_property
id=
'base_category'
>
follow_up
</multi_property>
</role>
</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'
>
<role
id=
'Assignor'
>
<property
id=
'title'
>
Self Compute Node
</property>
<property
id=
'title'
>
Self Compute Node
</property>
<property
id=
'condition'
>
python: context.getUserId("") != ""
</property>
<property
id=
'condition'
>
python: context.getUserId("") != ""
</property>
...
...
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
View file @
0c22127e
...
@@ -414,14 +414,16 @@ class TestComputeNode(TestSlapOSGroupRoleSecurityMixin):
...
@@ -414,14 +414,16 @@ class TestComputeNode(TestSlapOSGroupRoleSecurityMixin):
def
test_ComputeNode_userId
(
self
):
def
test_ComputeNode_userId
(
self
):
compute_node
=
self
.
portal
.
compute_node_module
.
newContent
(
portal_type
=
'Compute Node'
)
compute_node
=
self
.
portal
.
compute_node_module
.
newContent
(
portal_type
=
'Compute Node'
)
self
.
assertSecurityGroup
(
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
,
self
.
user_id
,
[
'Owner'
])
self
.
assertRoles
(
compute_node
,
compute_node
.
getUserId
(),
[
'Assignor'
])
self
.
assertRoles
(
compute_node
,
compute_node
.
getUserId
(),
[
'Assignor'
])
self
.
assertRoles
(
compute_node
,
'F-SALE*'
,
[
'Auditor'
])
compute_node
.
edit
(
user_id
=
None
)
compute_node
.
edit
(
user_id
=
None
)
self
.
assertSecurityGroup
(
compute_node
,
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
,
self
.
user_id
,
[
'Owner'
])
self
.
assertRoles
(
compute_node
,
'F-SALE*'
,
[
'Auditor'
])
def
test_ComputeNode_ProjectMember
(
self
):
def
test_ComputeNode_ProjectMember
(
self
):
project
=
self
.
addProject
()
project
=
self
.
addProject
()
...
@@ -437,6 +439,7 @@ class TestComputeNode(TestSlapOSGroupRoleSecurityMixin):
...
@@ -437,6 +439,7 @@ class TestComputeNode(TestSlapOSGroupRoleSecurityMixin):
'%s_F-PRODMAN'
%
project
.
getReference
(),
'%s_F-PRODMAN'
%
project
.
getReference
(),
'%s_F-CUSTOMER'
%
project
.
getReference
(),
'%s_F-CUSTOMER'
%
project
.
getReference
(),
'%s_R-INSTANCE'
%
project
.
getReference
(),
'%s_R-INSTANCE'
%
project
.
getReference
(),
'F-SALE*'
,
],
False
)
],
False
)
self
.
assertRoles
(
compute_node
,
self
.
user_id
,
[
'Owner'
])
self
.
assertRoles
(
compute_node
,
self
.
user_id
,
[
'Owner'
])
self
.
assertRoles
(
compute_node
,
compute_node
.
getUserId
(),
[
'Assignor'
])
self
.
assertRoles
(
compute_node
,
compute_node
.
getUserId
(),
[
'Assignor'
])
...
@@ -444,6 +447,7 @@ class TestComputeNode(TestSlapOSGroupRoleSecurityMixin):
...
@@ -444,6 +447,7 @@ class TestComputeNode(TestSlapOSGroupRoleSecurityMixin):
self
.
assertRoles
(
compute_node
,
'%s_F-PRODMAN'
%
project
.
getReference
(),
[
'Assignor'
])
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_F-CUSTOMER'
%
project
.
getReference
(),
[
'Auditor'
])
self
.
assertRoles
(
compute_node
,
'%s_R-INSTANCE'
%
project
.
getReference
(),
[
'Auditor'
])
self
.
assertRoles
(
compute_node
,
'%s_R-INSTANCE'
%
project
.
getReference
(),
[
'Auditor'
])
self
.
assertRoles
(
compute_node
,
'F-SALE*'
,
[
'Auditor'
])
class
TestInstanceNode
(
TestSlapOSGroupRoleSecurityMixin
):
class
TestInstanceNode
(
TestSlapOSGroupRoleSecurityMixin
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment