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
Thomas Gambier
slapos.core
Commits
126bb776
Commit
126bb776
authored
Nov 22, 2021
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_erp5: Add security for Subscription Condition
Same as Subscription Requests
parent
e2cebc0c
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
42 additions
and
0 deletions
+42
-0
master/bt5/slapos_erp5/LocalRolesTemplateItem/subscription_condition_module.xml
.../LocalRolesTemplateItem/subscription_condition_module.xml
+4
-0
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Subscription%20Condition%20Module.xml
...peRolesTemplateItem/Subscription%20Condition%20Module.xml
+8
-0
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Subscription%20Condition.xml
.../PortalTypeRolesTemplateItem/Subscription%20Condition.xml
+8
-0
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
...l_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
+19
-0
master/bt5/slapos_erp5/bt/template_local_role_list
master/bt5/slapos_erp5/bt/template_local_role_list
+1
-0
master/bt5/slapos_erp5/bt/template_portal_type_role_list
master/bt5/slapos_erp5/bt/template_portal_type_role_list
+2
-0
No files found.
master/bt5/slapos_erp5/LocalRolesTemplateItem/subscription_condition_module.xml
0 → 100644
View file @
126bb776
<local_roles_item>
<local_roles>
</local_roles>
</local_roles_item>
\ No newline at end of file
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Subscription%20Condition%20Module.xml
0 → 100644
View file @
126bb776
<type_roles>
<role
id=
'Auditor; Author'
>
<property
id=
'title'
>
Company group
</property>
<multi_property
id=
'categories'
>
local_role_group/group
</multi_property>
<multi_property
id=
'category'
>
group/company
</multi_property>
<multi_property
id=
'base_category'
>
group
</multi_property>
</role>
</type_roles>
\ No newline at end of file
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Subscription%20Condition.xml
0 → 100644
View file @
126bb776
<type_roles>
<role
id=
'Assignor'
>
<property
id=
'title'
>
Company group
</property>
<multi_property
id=
'categories'
>
local_role_group/group
</multi_property>
<multi_property
id=
'category'
>
group/company
</multi_property>
<multi_property
id=
'base_category'
>
group
</multi_property>
</role>
</type_roles>
\ No newline at end of file
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
View file @
126bb776
...
@@ -1712,6 +1712,25 @@ class TestSubscriptionRequest(TestSlapOSGroupRoleSecurityMixin):
...
@@ -1712,6 +1712,25 @@ class TestSubscriptionRequest(TestSlapOSGroupRoleSecurityMixin):
self
.
assertRoles
(
subscription_request
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
subscription_request
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
subscription_request
,
self
.
user_id
,
[
'Owner'
])
self
.
assertRoles
(
subscription_request
,
self
.
user_id
,
[
'Owner'
])
class
TestSubscriptionConditionModule
(
TestSlapOSGroupRoleSecurityMixin
):
def
test
(
self
):
module
=
self
.
portal
.
subscription_condition_module
self
.
changeOwnership
(
module
)
self
.
assertSecurityGroup
(
module
,
[
'G-COMPANY'
,
self
.
user_id
],
False
)
self
.
assertRoles
(
module
,
'G-COMPANY'
,
[
'Auditor'
,
'Author'
])
self
.
assertRoles
(
module
,
self
.
user_id
,
[
'Owner'
])
class
TestSubscriptionRequest
(
TestSlapOSGroupRoleSecurityMixin
):
def
test_GroupCompany
(
self
):
subscription_condition
=
self
.
portal
.
subscription_condition_module
.
newContent
(
portal_type
=
'Subscription Condition'
)
subscription_condition
.
updateLocalRolesOnSecurityGroups
()
self
.
assertSecurityGroup
(
subscription_condition
,
[
'G-COMPANY'
,
self
.
user_id
],
False
)
self
.
assertRoles
(
subscription_condition
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
subscription_condition
,
self
.
user_id
,
[
'Owner'
])
class
TestCashRegister
(
TestSlapOSGroupRoleSecurityMixin
):
class
TestCashRegister
(
TestSlapOSGroupRoleSecurityMixin
):
def
test_GroupCompany
(
self
):
def
test_GroupCompany
(
self
):
product
=
self
.
portal
.
organisation_module
.
newContent
(
product
=
self
.
portal
.
organisation_module
.
newContent
(
...
...
master/bt5/slapos_erp5/bt/template_local_role_list
View file @
126bb776
...
@@ -110,6 +110,7 @@ software_installation_module
...
@@ -110,6 +110,7 @@ software_installation_module
software_instance_module
software_instance_module
software_product_module
software_product_module
software_release_module
software_release_module
subscription_condition_module
subscription_request_module
subscription_request_module
support_request_module
support_request_module
support_request_module/slapos_crm_support_request_template
support_request_module/slapos_crm_support_request_template
...
...
master/bt5/slapos_erp5/bt/template_portal_type_role_list
View file @
126bb776
...
@@ -117,6 +117,8 @@ Software Product Module
...
@@ -117,6 +117,8 @@ Software Product Module
Software Release
Software Release
Software Release Module
Software Release Module
Spreadsheet
Spreadsheet
Subscription Condition
Subscription Condition Module
Subscription Request
Subscription Request
Subscription Request Module
Subscription Request Module
Support Request
Support Request
...
...
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