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
Léo-Paul Géneau
slapos.core
Commits
4e4187d0
Commit
4e4187d0
authored
Dec 06, 2021
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_erp5: Don't rely on Owner Role
This allows the project owner leave the project if he would like too
parent
fc56880e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
4 deletions
+20
-4
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Project.xml
...r/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Project.xml
+2
-3
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
...l_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
+17
-1
master/bt5/slapos_erp5/WorkflowTemplateItem/portal_workflow/local_permission_slapos_interaction_workflow/interaction_Organisation_edit.xml
...os_interaction_workflow/interaction_Organisation_edit.xml
+1
-0
No files found.
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Project.xml
View file @
4e4187d0
...
...
@@ -7,10 +7,9 @@
</role>
<role
id=
'Assignee'
>
<property
id=
'title'
>
Person Owner
</property>
<property
id=
'description'
>
XXXX Review this later
</property>
<property
id=
'base_category_script'
>
ERP5Type_acquireSecurityFromOwner
</property>
<property
id=
'base_category_script'
>
ERP5Type_getSecurityCategoryFromContent
</property>
<multi_property
id=
'categories'
>
local_role_group/user
</multi_property>
<multi_property
id=
'base_category'
>
source
</multi_property>
<multi_property
id=
'base_category'
>
destination_decision
</multi_property>
</role>
<role
id=
'Auditor'
>
<property
id=
'title'
>
Person Shadow
</property>
...
...
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
View file @
4e4187d0
...
...
@@ -681,6 +681,21 @@ class TestProjectModule(TestSlapOSGroupRoleSecurityMixin):
class
TestProject
(
TestSlapOSGroupRoleSecurityMixin
):
def
test_with_user
(
self
):
person
=
self
.
makePerson
(
user
=
1
)
project
=
self
.
portal
.
project_module
.
newContent
(
portal_type
=
'Project'
,
destination_decision_value
=
person
)
project
.
updateLocalRolesOnSecurityGroups
()
self
.
assertSecurityGroup
(
project
,
[
'G-COMPANY'
,
self
.
user_id
,
person
.
getUserId
(),
project
.
getReference
(),
'R-SHADOW-PERSON'
],
False
)
self
.
assertRoles
(
project
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
project
,
project
.
getReference
(),
[
'Assignee'
])
self
.
assertRoles
(
project
,
'R-SHADOW-PERSON'
,
[
'Auditor'
])
self
.
assertRoles
(
project
,
self
.
user_id
,
[
'Owner'
])
self
.
assertRoles
(
project
,
person
.
getUserId
(),
[
'Assignee'
])
def
test
(
self
):
project
=
self
.
portal
.
project_module
.
newContent
(
portal_type
=
'Project'
)
...
...
@@ -690,7 +705,8 @@ class TestProject(TestSlapOSGroupRoleSecurityMixin):
self
.
assertRoles
(
project
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
project
,
project
.
getReference
(),
[
'Assignee'
])
self
.
assertRoles
(
project
,
'R-SHADOW-PERSON'
,
[
'Auditor'
])
self
.
assertRoles
(
project
,
self
.
user_id
,
[
'Owner'
,
'Assignee'
])
self
.
assertRoles
(
project
,
self
.
user_id
,
[
'Owner'
])
class
TestPDF
(
TestSlapOSGroupRoleSecurityMixin
):
def
test
(
self
):
...
...
master/bt5/slapos_erp5/WorkflowTemplateItem/portal_workflow/local_permission_slapos_interaction_workflow/interaction_Organisation_edit.xml
View file @
4e4187d0
...
...
@@ -52,6 +52,7 @@
<value>
<tuple>
<string>
_setReference.*
</string>
<string>
_setDestinationDecision.*
</string>
</tuple>
</value>
</item>
...
...
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