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
1
Merge Requests
1
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
Romain Courteaud
slapos.core
Commits
084a9c98
Commit
084a9c98
authored
Feb 13, 2024
by
Romain Courteaud
🐸
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_erp5: fixup ticket/event local roles
Sale must have some access on module
parent
3f30ea88
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
37 additions
and
43 deletions
+37
-43
master/bt5/slapos_erp5/LocalRolesTemplateItem/event_module.xml
...r/bt5/slapos_erp5/LocalRolesTemplateItem/event_module.xml
+6
-0
master/bt5/slapos_erp5/LocalRolesTemplateItem/regularisation_request_module.xml
.../LocalRolesTemplateItem/regularisation_request_module.xml
+2
-2
master/bt5/slapos_erp5/LocalRolesTemplateItem/support_request_module.xml
...os_erp5/LocalRolesTemplateItem/support_request_module.xml
+6
-0
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Event%20Module.xml
...lapos_erp5/PortalTypeRolesTemplateItem/Event%20Module.xml
+6
-0
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Regularisation%20Request%20Module.xml
...peRolesTemplateItem/Regularisation%20Request%20Module.xml
+4
-4
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Support%20Request%20Module.xml
...ortalTypeRolesTemplateItem/Support%20Request%20Module.xml
+6
-0
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
...l_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
+7
-37
No files found.
master/bt5/slapos_erp5/LocalRolesTemplateItem/event_module.xml
View file @
084a9c98
...
...
@@ -8,6 +8,10 @@
<item>
Auditor
</item>
<item>
Author
</item>
</role>
<role
id=
'F-SALE*'
>
<item>
Auditor
</item>
<item>
Author
</item>
</role>
</local_roles>
<local_role_group_ids>
<local_role_group_id
id=
'function'
>
...
...
@@ -15,6 +19,8 @@
<principal
id=
'F-CUSTOMER'
>
Author
</principal>
<principal
id=
'F-PRODUCTION*'
>
Auditor
</principal>
<principal
id=
'F-PRODUCTION*'
>
Author
</principal>
<principal
id=
'F-SALE*'
>
Auditor
</principal>
<principal
id=
'F-SALE*'
>
Author
</principal>
</local_role_group_id>
</local_role_group_ids>
</local_roles_item>
\ No newline at end of file
master/bt5/slapos_erp5/LocalRolesTemplateItem/regularisation_request_module.xml
View file @
084a9c98
...
...
@@ -3,14 +3,14 @@
<role
id=
'F-CUSTOMER'
>
<item>
Auditor
</item>
</role>
<role
id=
'F-
PRODUCTION
*'
>
<role
id=
'F-
SALE
*'
>
<item>
Auditor
</item>
</role>
</local_roles>
<local_role_group_ids>
<local_role_group_id
id=
'function'
>
<principal
id=
'F-CUSTOMER'
>
Auditor
</principal>
<principal
id=
'F-
PRODUCTION
*'
>
Auditor
</principal>
<principal
id=
'F-
SALE
*'
>
Auditor
</principal>
</local_role_group_id>
</local_role_group_ids>
</local_roles_item>
\ No newline at end of file
master/bt5/slapos_erp5/LocalRolesTemplateItem/support_request_module.xml
View file @
084a9c98
...
...
@@ -8,6 +8,10 @@
<item>
Auditor
</item>
<item>
Author
</item>
</role>
<role
id=
'F-SALE*'
>
<item>
Auditor
</item>
<item>
Author
</item>
</role>
</local_roles>
<local_role_group_ids>
<local_role_group_id
id=
'function'
>
...
...
@@ -15,6 +19,8 @@
<principal
id=
'F-CUSTOMER'
>
Author
</principal>
<principal
id=
'F-PRODUCTION*'
>
Auditor
</principal>
<principal
id=
'F-PRODUCTION*'
>
Author
</principal>
<principal
id=
'F-SALE*'
>
Auditor
</principal>
<principal
id=
'F-SALE*'
>
Author
</principal>
</local_role_group_id>
</local_role_group_ids>
</local_roles_item>
\ No newline at end of file
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Event%20Module.xml
View file @
084a9c98
...
...
@@ -11,4 +11,10 @@
<multi_property
id=
'category'
>
function/production*
</multi_property>
<multi_property
id=
'base_category'
>
function
</multi_property>
</role>
<role
id=
'Auditor; Author'
>
<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>
</type_roles>
\ No newline at end of file
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Regularisation%20Request%20Module.xml
View file @
084a9c98
<type_roles>
<role
id=
'Auditor'
>
<property
id=
'title'
>
Pro
duction
</property>
<property
id=
'title'
>
Pro
ject Customer
</property>
<multi_property
id=
'categories'
>
local_role_group/function
</multi_property>
<multi_property
id=
'category'
>
function/
production*
</multi_property>
<multi_property
id=
'category'
>
function/
customer
</multi_property>
<multi_property
id=
'base_category'
>
function
</multi_property>
</role>
<role
id=
'Auditor'
>
<property
id=
'title'
>
Project Customer
</property>
<property
id=
'title'
>
Sale
</property>
<multi_property
id=
'categories'
>
local_role_group/function
</multi_property>
<multi_property
id=
'category'
>
function/
customer
</multi_property>
<multi_property
id=
'category'
>
function/
sale*
</multi_property>
<multi_property
id=
'base_category'
>
function
</multi_property>
</role>
</type_roles>
\ No newline at end of file
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Support%20Request%20Module.xml
View file @
084a9c98
...
...
@@ -11,4 +11,10 @@
<multi_property
id=
'category'
>
function/customer
</multi_property>
<multi_property
id=
'base_category'
>
function
</multi_property>
</role>
<role
id=
'Auditor; Author'
>
<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>
</type_roles>
\ No newline at end of file
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
View file @
084a9c98
...
...
@@ -602,8 +602,9 @@ class TestEventModule(TestSlapOSGroupRoleSecurityMixin):
def
test
(
self
):
module
=
self
.
portal
.
event_module
self
.
assertSecurityGroup
(
module
,
[
'F-PRODUCTION*'
,
'F-CUSTOMER'
,
module
.
Base_getOwnerId
()],
True
)
[
'F-PRODUCTION*'
,
'F-
SALE*'
,
'F-
CUSTOMER'
,
module
.
Base_getOwnerId
()],
True
)
self
.
assertRoles
(
module
,
'F-PRODUCTION*'
,
[
'Auditor'
,
'Author'
])
self
.
assertRoles
(
module
,
'F-SALE*'
,
[
'Auditor'
,
'Author'
])
self
.
assertRoles
(
module
,
'F-CUSTOMER'
,
[
'Auditor'
,
'Author'
])
self
.
assertRoles
(
module
,
module
.
Base_getOwnerId
(),
[
'Owner'
])
...
...
@@ -1011,8 +1012,9 @@ class TestSupportRequestModule(TestSlapOSGroupRoleSecurityMixin):
def
test_SupportRequestModule
(
self
):
module
=
self
.
portal
.
support_request_module
self
.
assertSecurityGroup
(
module
,
[
'F-PRODUCTION*'
,
'F-CUSTOMER'
,
module
.
Base_getOwnerId
()],
True
)
[
'F-PRODUCTION*'
,
'F-
SALE*'
,
'F-
CUSTOMER'
,
module
.
Base_getOwnerId
()],
True
)
self
.
assertRoles
(
module
,
'F-PRODUCTION*'
,
[
'Auditor'
,
'Author'
])
self
.
assertRoles
(
module
,
'F-SALE*'
,
[
'Auditor'
,
'Author'
])
self
.
assertRoles
(
module
,
'F-CUSTOMER'
,
[
'Auditor'
,
'Author'
])
self
.
assertRoles
(
module
,
module
.
Base_getOwnerId
(),
[
'Owner'
])
...
...
@@ -1073,11 +1075,11 @@ class TestSupportRequest(TestSlapOSGroupRoleSecurityMixin):
class
TestRegularisationRequestModule
(
TestSlapOSGroupRoleSecurityMixin
):
def
test
(
self
):
def
test
_RegularisationRequestModule
(
self
):
module
=
self
.
portal
.
regularisation_request_module
self
.
assertSecurityGroup
(
module
,
[
'F-
PRODUCTION
*'
,
'F-CUSTOMER'
,
module
.
Base_getOwnerId
()],
True
)
self
.
assertRoles
(
module
,
'F-
PRODUCTION
*'
,
[
'Auditor'
])
[
'F-
SALE
*'
,
'F-CUSTOMER'
,
module
.
Base_getOwnerId
()],
True
)
self
.
assertRoles
(
module
,
'F-
SALE
*'
,
[
'Auditor'
])
self
.
assertRoles
(
module
,
'F-CUSTOMER'
,
[
'Auditor'
])
self
.
assertRoles
(
module
,
module
.
Base_getOwnerId
(),
[
'Owner'
])
...
...
@@ -1109,38 +1111,6 @@ class TestRegularisationRequest(TestSlapOSGroupRoleSecurityMixin):
self
.
assertRoles
(
support_request
,
'F-SALEMAN'
,
[
'Assignor'
])
self
.
assertRoles
(
support_request
,
'F-SALEAGT'
,
[
'Assignee'
])
def
test_RegularisationRequest_SourceProject
(
self
):
project
=
self
.
addProject
()
support_request
=
self
.
portal
.
getDefaultModuleValue
(
self
.
ticket_portal_type
).
newContent
(
portal_type
=
self
.
ticket_portal_type
)
support_request
.
edit
(
source_project_value
=
project
)
self
.
assertSecurityGroup
(
support_request
,
[
self
.
user_id
,
'%s_F-PRODAGNT'
%
project
.
getReference
(),
'%s_F-PRODMAN'
%
project
.
getReference
(),
'F-SALEAGT'
,
'F-SALEMAN'
],
False
)
self
.
assertRoles
(
support_request
,
self
.
user_id
,
[
'Owner'
])
self
.
assertRoles
(
support_request
,
'%s_F-PRODMAN'
%
project
.
getReference
(),
[
'Assignor'
])
self
.
assertRoles
(
support_request
,
'%s_F-PRODAGNT'
%
project
.
getReference
(),
[
'Assignee'
])
self
.
assertRoles
(
support_request
,
'F-SALEMAN'
,
[
'Assignor'
])
self
.
assertRoles
(
support_request
,
'F-SALEAGT'
,
[
'Assignee'
])
def
test_RegularisationRequest_DestinationProject
(
self
):
project
=
self
.
addProject
()
support_request
=
self
.
portal
.
getDefaultModuleValue
(
self
.
ticket_portal_type
).
newContent
(
portal_type
=
self
.
ticket_portal_type
)
support_request
.
edit
(
destination_project_value
=
project
)
self
.
assertSecurityGroup
(
support_request
,
[
self
.
user_id
,
'%s_F-PRODAGNT'
%
project
.
getReference
(),
'%s_F-PRODMAN'
%
project
.
getReference
(),
'F-SALEAGT'
,
'F-SALEMAN'
],
False
)
self
.
assertRoles
(
support_request
,
self
.
user_id
,
[
'Owner'
])
self
.
assertRoles
(
support_request
,
'%s_F-PRODMAN'
%
project
.
getReference
(),
[
'Assignor'
])
self
.
assertRoles
(
support_request
,
'%s_F-PRODAGNT'
%
project
.
getReference
(),
[
'Assignee'
])
self
.
assertRoles
(
support_request
,
'F-SALEMAN'
,
[
'Assignor'
])
self
.
assertRoles
(
support_request
,
'F-SALEAGT'
,
[
'Assignee'
])
class
TestSystemEventModule
(
TestSlapOSGroupRoleSecurityMixin
):
def
test_SystemEventModule
(
self
):
...
...
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