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
Titouan Soulard
slapos.core
Commits
b3213816
Commit
b3213816
authored
Oct 04, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_erp5: sale agt/manager can handle Regularisation/Support Request
parent
fd5c7ba9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
89 additions
and
3 deletions
+89
-3
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Regularisation%20Request.xml
.../PortalTypeRolesTemplateItem/Regularisation%20Request.xml
+12
-0
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
...l_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
+77
-3
No files found.
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Regularisation%20Request.xml
View file @
b3213816
...
...
@@ -29,6 +29,18 @@
<multi_property
id=
'category'
>
role/member
</multi_property>
<multi_property
id=
'base_category'
>
role
</multi_property>
</role>
<role
id=
'Assignee'
>
<property
id=
'title'
>
Sale Agent
</property>
<multi_property
id=
'categories'
>
local_role_group/function
</multi_property>
<multi_property
id=
'category'
>
function/sale/agent
</multi_property>
<multi_property
id=
'base_category'
>
function
</multi_property>
</role>
<role
id=
'Assignor'
>
<property
id=
'title'
>
Sale Manager
</property>
<multi_property
id=
'categories'
>
local_role_group/function
</multi_property>
<multi_property
id=
'category'
>
function/sale/manager
</multi_property>
<multi_property
id=
'base_category'
>
function
</multi_property>
</role>
<role
id=
'Assignee'
>
<property
id=
'title'
>
Source Project Production Agent
</property>
<property
id=
'description'
>
XXX add local role group
</property>
...
...
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
View file @
b3213816
...
...
@@ -951,8 +951,10 @@ class TestSupportRequest(TestSlapOSGroupRoleSecurityMixin):
support_request
=
self
.
portal
.
getDefaultModuleValue
(
self
.
ticket_portal_type
).
newContent
(
portal_type
=
self
.
ticket_portal_type
)
self
.
assertSecurityGroup
(
support_request
,
[
self
.
user_id
],
False
)
[
self
.
user_id
,
'F-SALEAGT'
,
'F-SALEMAN'
],
False
)
self
.
assertRoles
(
support_request
,
self
.
user_id
,
[
'Owner'
])
self
.
assertRoles
(
support_request
,
'F-SALEMAN'
,
[
'Assignor'
])
self
.
assertRoles
(
support_request
,
'F-SALEAGT'
,
[
'Assignee'
])
def
test_SupportRequest_Customer
(
self
):
reference
=
'TESTPERSON-%s'
%
self
.
generateNewId
()
...
...
@@ -964,9 +966,11 @@ class TestSupportRequest(TestSlapOSGroupRoleSecurityMixin):
destination_decision_value
=
person
,
)
self
.
assertSecurityGroup
(
support_request
,
[
person
.
getUserId
(),
self
.
user_id
],
False
)
[
person
.
getUserId
(),
self
.
user_id
,
'F-SALEAGT'
,
'F-SALEMAN'
],
False
)
self
.
assertRoles
(
support_request
,
person
.
getUserId
(),
[
'Auditor'
])
self
.
assertRoles
(
support_request
,
self
.
user_id
,
[
'Owner'
])
self
.
assertRoles
(
support_request
,
'F-SALEMAN'
,
[
'Assignor'
])
self
.
assertRoles
(
support_request
,
'F-SALEAGT'
,
[
'Assignee'
])
def
test_SupportRequest_Template
(
self
):
support_request
=
self
.
portal
.
restrictedTraverse
(
getattr
(
...
...
@@ -1017,9 +1021,79 @@ class TestRegularisationRequestModule(TestSlapOSGroupRoleSecurityMixin):
self
.
assertRoles
(
module
,
'F-CUSTOMER'
,
[
'Auditor'
])
self
.
assertRoles
(
module
,
module
.
Base_getOwnerId
(),
[
'Owner'
])
class
TestRegularisationRequest
(
TestS
upportRequest
):
class
TestRegularisationRequest
(
TestS
lapOSGroupRoleSecurityMixin
):
ticket_portal_type
=
'Regularisation Request'
def
test_RegularisationRequest_default
(
self
):
support_request
=
self
.
portal
.
getDefaultModuleValue
(
self
.
ticket_portal_type
).
newContent
(
portal_type
=
self
.
ticket_portal_type
)
self
.
assertSecurityGroup
(
support_request
,
[
self
.
user_id
,
'F-SALEAGT'
,
'F-SALEMAN'
],
False
)
self
.
assertRoles
(
support_request
,
self
.
user_id
,
[
'Owner'
])
self
.
assertRoles
(
support_request
,
'F-SALEMAN'
,
[
'Assignor'
])
self
.
assertRoles
(
support_request
,
'F-SALEAGT'
,
[
'Assignee'
])
def
test_RegularisationRequest_Customer
(
self
):
reference
=
'TESTPERSON-%s'
%
self
.
generateNewId
()
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
reference
=
reference
)
support_request
=
self
.
portal
.
getDefaultModuleValue
(
self
.
ticket_portal_type
).
newContent
(
portal_type
=
self
.
ticket_portal_type
)
support_request
.
edit
(
destination_decision_value
=
person
,
)
self
.
assertSecurityGroup
(
support_request
,
[
person
.
getUserId
(),
self
.
user_id
,
'F-SALEAGT'
,
'F-SALEMAN'
],
False
)
self
.
assertRoles
(
support_request
,
person
.
getUserId
(),
[
'Auditor'
])
self
.
assertRoles
(
support_request
,
self
.
user_id
,
[
'Owner'
])
self
.
assertRoles
(
support_request
,
'F-SALEMAN'
,
[
'Assignor'
])
self
.
assertRoles
(
support_request
,
'F-SALEAGT'
,
[
'Assignee'
])
def
test_RegularisationRequest_Template
(
self
):
support_request
=
self
.
portal
.
restrictedTraverse
(
getattr
(
self
.
portal
.
portal_preferences
,
'getPreferred%sTemplate'
%
self
.
ticket_portal_type
.
title
().
replace
(
' '
,
''
)
)())
assert
support_request
.
getPortalType
()
==
self
.
ticket_portal_type
self
.
assertSecurityGroup
(
support_request
,
[
support_request
.
Base_getOwnerId
(),
'R-MEMBER'
],
False
)
self
.
assertRoles
(
support_request
,
support_request
.
Base_getOwnerId
(),
[
'Owner'
])
self
.
assertRoles
(
support_request
,
'R-MEMBER'
,
[
'Auditor'
])
self
.
assertPermissionsOfRole
(
support_request
,
'Auditor'
,
[
'Access contents information'
,
'View'
])
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