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
Labels
Merge Requests
17
Merge Requests
17
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos.core
Commits
af9079b2
Commit
af9079b2
authored
May 27, 2024
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_erp5: Sale user can see Software Product and Instance Tree
parent
107d91ef
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
5 deletions
+34
-5
master/bt5/slapos_erp5/LocalRolesTemplateItem/instance_tree_module.xml
...apos_erp5/LocalRolesTemplateItem/instance_tree_module.xml
+4
-0
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Instance%20Tree%20Module.xml
.../PortalTypeRolesTemplateItem/Instance%20Tree%20Module.xml
+6
-0
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Instance%20Tree.xml
...apos_erp5/PortalTypeRolesTemplateItem/Instance%20Tree.xml
+6
-0
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Software%20Product.xml
...s_erp5/PortalTypeRolesTemplateItem/Software%20Product.xml
+6
-0
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
...l_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
+12
-5
No files found.
master/bt5/slapos_erp5/LocalRolesTemplateItem/instance_tree_module.xml
View file @
af9079b2
...
@@ -7,6 +7,9 @@
...
@@ -7,6 +7,9 @@
<role
id=
'F-PRODUCTION*'
>
<role
id=
'F-PRODUCTION*'
>
<item>
Auditor
</item>
<item>
Auditor
</item>
</role>
</role>
<role
id=
'F-SALE*'
>
<item>
Auditor
</item>
</role>
<role
id=
'R-COMPUTER'
>
<role
id=
'R-COMPUTER'
>
<item>
Auditor
</item>
<item>
Auditor
</item>
</role>
</role>
...
@@ -23,6 +26,7 @@
...
@@ -23,6 +26,7 @@
<principal
id=
'F-CUSTOMER'
>
Auditor
</principal>
<principal
id=
'F-CUSTOMER'
>
Auditor
</principal>
<principal
id=
'F-CUSTOMER'
>
Author
</principal>
<principal
id=
'F-CUSTOMER'
>
Author
</principal>
<principal
id=
'F-PRODUCTION*'
>
Auditor
</principal>
<principal
id=
'F-PRODUCTION*'
>
Auditor
</principal>
<principal
id=
'F-SALE*'
>
Auditor
</principal>
</local_role_group_id>
</local_role_group_id>
</local_role_group_ids>
</local_role_group_ids>
</local_roles_item>
</local_roles_item>
\ No newline at end of file
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Instance%20Tree%20Module.xml
View file @
af9079b2
...
@@ -23,4 +23,10 @@
...
@@ -23,4 +23,10 @@
<multi_property
id=
'category'
>
function/customer
</multi_property>
<multi_property
id=
'category'
>
function/customer
</multi_property>
<multi_property
id=
'base_category'
>
function
</multi_property>
<multi_property
id=
'base_category'
>
function
</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>
</type_roles>
</type_roles>
\ No newline at end of file
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Instance%20Tree.xml
View file @
af9079b2
...
@@ -29,4 +29,10 @@
...
@@ -29,4 +29,10 @@
<multi_property
id=
'categories'
>
local_role_group/subscription
</multi_property>
<multi_property
id=
'categories'
>
local_role_group/subscription
</multi_property>
<multi_property
id=
'base_category'
>
aggregate
</multi_property>
<multi_property
id=
'base_category'
>
aggregate
</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>
</type_roles>
</type_roles>
\ No newline at end of file
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Software%20Product.xml
View file @
af9079b2
...
@@ -26,4 +26,10 @@
...
@@ -26,4 +26,10 @@
<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>
</type_roles>
</type_roles>
\ No newline at end of file
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
View file @
af9079b2
...
@@ -715,11 +715,12 @@ class TestInstanceTreeModule(TestSlapOSGroupRoleSecurityMixin):
...
@@ -715,11 +715,12 @@ class TestInstanceTreeModule(TestSlapOSGroupRoleSecurityMixin):
def
test_InstanceTreeModule
(
self
):
def
test_InstanceTreeModule
(
self
):
module
=
self
.
portal
.
instance_tree_module
module
=
self
.
portal
.
instance_tree_module
self
.
assertSecurityGroup
(
module
,
self
.
assertSecurityGroup
(
module
,
[
'F-PRODUCTION*'
,
'R-COMPUTER'
,
'F-CUSTOMER'
,
'R-INSTANCE'
,
module
.
Base_getOwnerId
()],
False
)
[
'F-PRODUCTION*'
,
'R-COMPUTER'
,
'F-CUSTOMER'
,
'
F-SALE*'
,
'
R-INSTANCE'
,
module
.
Base_getOwnerId
()],
False
)
self
.
assertRoles
(
module
,
'F-CUSTOMER'
,
[
'Auditor'
,
'Author'
])
self
.
assertRoles
(
module
,
'F-CUSTOMER'
,
[
'Auditor'
,
'Author'
])
self
.
assertRoles
(
module
,
'R-COMPUTER'
,
[
'Auditor'
])
self
.
assertRoles
(
module
,
'R-COMPUTER'
,
[
'Auditor'
])
self
.
assertRoles
(
module
,
'R-INSTANCE'
,
[
'Auditor'
])
self
.
assertRoles
(
module
,
'R-INSTANCE'
,
[
'Auditor'
])
self
.
assertRoles
(
module
,
'F-PRODUCTION*'
,
[
'Auditor'
])
self
.
assertRoles
(
module
,
'F-PRODUCTION*'
,
[
'Auditor'
])
self
.
assertRoles
(
module
,
'F-SALE*'
,
[
'Auditor'
])
self
.
assertRoles
(
module
,
module
.
Base_getOwnerId
(),
[
'Owner'
])
self
.
assertRoles
(
module
,
module
.
Base_getOwnerId
(),
[
'Owner'
])
...
@@ -730,9 +731,10 @@ class TestInstanceTree(TestSlapOSGroupRoleSecurityMixin):
...
@@ -730,9 +731,10 @@ class TestInstanceTree(TestSlapOSGroupRoleSecurityMixin):
portal_type
=
'Instance Tree'
)
portal_type
=
'Instance Tree'
)
subscription
.
edit
(
reference
=
reference
)
subscription
.
edit
(
reference
=
reference
)
self
.
assertSecurityGroup
(
subscription
,
[
self
.
user_id
,
reference
],
False
)
self
.
assertSecurityGroup
(
subscription
,
[
self
.
user_id
,
'F-SALE*'
,
reference
],
False
)
self
.
assertRoles
(
subscription
,
reference
,
[
'Assignee'
])
self
.
assertRoles
(
subscription
,
reference
,
[
'Assignee'
])
self
.
assertRoles
(
subscription
,
self
.
user_id
,
[
'Owner'
])
self
.
assertRoles
(
subscription
,
self
.
user_id
,
[
'Owner'
])
self
.
assertRoles
(
subscription
,
'F-SALE*'
,
[
'Auditor'
])
def
test_InstanceTree_CustomOfTheInstanceTree
(
self
):
def
test_InstanceTree_CustomOfTheInstanceTree
(
self
):
customer_reference
=
'TESTPERSON-%s'
%
self
.
generateNewId
()
customer_reference
=
'TESTPERSON-%s'
%
self
.
generateNewId
()
...
@@ -744,9 +746,10 @@ class TestInstanceTree(TestSlapOSGroupRoleSecurityMixin):
...
@@ -744,9 +746,10 @@ class TestInstanceTree(TestSlapOSGroupRoleSecurityMixin):
subscription
.
edit
(
subscription
.
edit
(
destination_section_value
=
customer
)
destination_section_value
=
customer
)
self
.
assertSecurityGroup
(
subscription
,
[
self
.
user_id
,
reference
,
self
.
assertSecurityGroup
(
subscription
,
[
self
.
user_id
,
'F-SALE*'
,
reference
,
customer
.
getUserId
()],
False
)
customer
.
getUserId
()],
False
)
self
.
assertRoles
(
subscription
,
reference
,
[
'Assignee'
])
self
.
assertRoles
(
subscription
,
reference
,
[
'Assignee'
])
self
.
assertRoles
(
subscription
,
'F-SALE*'
,
[
'Auditor'
])
self
.
assertRoles
(
subscription
,
customer
.
getUserId
(),
[
'Assignee'
])
self
.
assertRoles
(
subscription
,
customer
.
getUserId
(),
[
'Assignee'
])
self
.
assertRoles
(
subscription
,
self
.
user_id
,
[
'Owner'
])
self
.
assertRoles
(
subscription
,
self
.
user_id
,
[
'Owner'
])
...
@@ -759,11 +762,12 @@ class TestInstanceTree(TestSlapOSGroupRoleSecurityMixin):
...
@@ -759,11 +762,12 @@ class TestInstanceTree(TestSlapOSGroupRoleSecurityMixin):
portal_type
=
'Instance Tree'
,
reference
=
reference
)
portal_type
=
'Instance Tree'
,
reference
=
reference
)
subscription
.
edit
(
subscription
.
edit
(
follow_up_value
=
project
)
follow_up_value
=
project
)
self
.
assertSecurityGroup
(
subscription
,
[
self
.
user_id
,
reference
,
self
.
assertSecurityGroup
(
subscription
,
[
self
.
user_id
,
'F-SALE*'
,
reference
,
'%s_F-PRODAGNT'
%
project
.
getReference
(),
'%s_F-PRODAGNT'
%
project
.
getReference
(),
'%s_F-PRODMAN'
%
project
.
getReference
()],
False
)
'%s_F-PRODMAN'
%
project
.
getReference
()],
False
)
self
.
assertRoles
(
subscription
,
reference
,
[
'Assignee'
])
self
.
assertRoles
(
subscription
,
reference
,
[
'Assignee'
])
self
.
assertRoles
(
subscription
,
self
.
user_id
,
[
'Owner'
])
self
.
assertRoles
(
subscription
,
self
.
user_id
,
[
'Owner'
])
self
.
assertRoles
(
subscription
,
'F-SALE*'
,
[
'Auditor'
])
self
.
assertRoles
(
subscription
,
'%s_F-PRODMAN'
%
project
.
getReference
(),
[
'Assignor'
])
self
.
assertRoles
(
subscription
,
'%s_F-PRODMAN'
%
project
.
getReference
(),
[
'Assignor'
])
self
.
assertRoles
(
subscription
,
'%s_F-PRODAGNT'
%
project
.
getReference
(),
[
'Assignee'
])
self
.
assertRoles
(
subscription
,
'%s_F-PRODAGNT'
%
project
.
getReference
(),
[
'Assignee'
])
...
@@ -989,8 +993,9 @@ class TestSoftwareProduct(TestSlapOSGroupRoleSecurityMixin):
...
@@ -989,8 +993,9 @@ class TestSoftwareProduct(TestSlapOSGroupRoleSecurityMixin):
product
=
self
.
portal
.
software_product_module
.
newContent
(
product
=
self
.
portal
.
software_product_module
.
newContent
(
portal_type
=
'Software Product'
)
portal_type
=
'Software Product'
)
self
.
assertSecurityGroup
(
product
,
self
.
assertSecurityGroup
(
product
,
[
self
.
user_id
],
False
)
[
self
.
user_id
,
'F-SALE*'
],
False
)
self
.
assertRoles
(
product
,
self
.
user_id
,
[
'Owner'
])
self
.
assertRoles
(
product
,
self
.
user_id
,
[
'Owner'
])
self
.
assertRoles
(
product
,
'F-SALE*'
,
[
'Auditor'
])
def
test_SoftwareProduct_Project
(
self
):
def
test_SoftwareProduct_Project
(
self
):
project
=
self
.
addProject
()
project
=
self
.
addProject
()
...
@@ -999,10 +1004,12 @@ class TestSoftwareProduct(TestSlapOSGroupRoleSecurityMixin):
...
@@ -999,10 +1004,12 @@ class TestSoftwareProduct(TestSlapOSGroupRoleSecurityMixin):
product
.
edit
(
product
.
edit
(
follow_up_value
=
project
)
follow_up_value
=
project
)
self
.
assertSecurityGroup
(
product
,
[
self
.
user_id
,
self
.
assertSecurityGroup
(
product
,
[
self
.
user_id
,
'F-SALE*'
,
'%s_F-CUSTOMER'
%
project
.
getReference
(),
'%s_F-CUSTOMER'
%
project
.
getReference
(),
'%s_F-PRODAGNT'
%
project
.
getReference
(),
'%s_F-PRODAGNT'
%
project
.
getReference
(),
'%s_F-PRODMAN'
%
project
.
getReference
()],
False
)
'%s_F-PRODMAN'
%
project
.
getReference
()],
False
)
self
.
assertRoles
(
product
,
self
.
user_id
,
[
'Owner'
])
self
.
assertRoles
(
product
,
self
.
user_id
,
[
'Owner'
])
self
.
assertRoles
(
product
,
'F-SALE*'
,
[
'Auditor'
])
self
.
assertRoles
(
product
,
'%s_F-PRODMAN'
%
project
.
getReference
(),
[
'Assignor'
])
self
.
assertRoles
(
product
,
'%s_F-PRODMAN'
%
project
.
getReference
(),
[
'Assignor'
])
self
.
assertRoles
(
product
,
'%s_F-PRODAGNT'
%
project
.
getReference
(),
[
'Assignee'
])
self
.
assertRoles
(
product
,
'%s_F-PRODAGNT'
%
project
.
getReference
(),
[
'Assignee'
])
self
.
assertRoles
(
product
,
'%s_F-CUSTOMER'
%
project
.
getReference
(),
[
'Auditor'
])
self
.
assertRoles
(
product
,
'%s_F-CUSTOMER'
%
project
.
getReference
(),
[
'Auditor'
])
...
...
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