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
Eric Zheng
slapos.core
Commits
1874e049
Commit
1874e049
authored
Sep 05, 2020
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_erp5: Update Security on Cloud Contract to allow Person view it
parent
5cb2bb6a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
5 deletions
+51
-5
master/bt5/slapos_erp5/LocalRolesTemplateItem/cloud_contract_module.xml
...pos_erp5/LocalRolesTemplateItem/cloud_contract_module.xml
+12
-0
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Cloud%20Contract%20Module.xml
...PortalTypeRolesTemplateItem/Cloud%20Contract%20Module.xml
+12
-0
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Cloud%20Contract.xml
...pos_erp5/PortalTypeRolesTemplateItem/Cloud%20Contract.xml
+7
-0
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
...l_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
+20
-5
No files found.
master/bt5/slapos_erp5/LocalRolesTemplateItem/cloud_contract_module.xml
View file @
1874e049
...
...
@@ -4,11 +4,23 @@
<item>
Auditor
</item>
<item>
Author
</item>
</role>
<role
id=
'R-MEMBER'
>
<item>
Auditor
</item>
</role>
<role
id=
'R-SHADOW-PERSON'
>
<item>
Auditor
</item>
</role>
</local_roles>
<local_role_group_ids>
<local_role_group_id
id=
'group'
>
<principal
id=
'G-COMPANY'
>
Auditor
</principal>
<principal
id=
'G-COMPANY'
>
Author
</principal>
</local_role_group_id>
<local_role_group_id
id=
'shadow'
>
<principal
id=
'R-SHADOW-PERSON'
>
Auditor
</principal>
</local_role_group_id>
<local_role_group_id
id=
'user'
>
<principal
id=
'R-MEMBER'
>
Auditor
</principal>
</local_role_group_id>
</local_role_group_ids>
</local_roles_item>
\ No newline at end of file
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Cloud%20Contract%20Module.xml
View file @
1874e049
...
...
@@ -5,4 +5,16 @@
<multi_property
id=
'category'
>
group/company
</multi_property>
<multi_property
id=
'base_category'
>
group
</multi_property>
</role>
<role
id=
'Auditor'
>
<property
id=
'title'
>
Member
</property>
<multi_property
id=
'categories'
>
local_role_group/user
</multi_property>
<multi_property
id=
'category'
>
role/member
</multi_property>
<multi_property
id=
'base_category'
>
role
</multi_property>
</role>
<role
id=
'Auditor'
>
<property
id=
'title'
>
Person Shadow
</property>
<multi_property
id=
'categories'
>
local_role_group/shadow
</multi_property>
<multi_property
id=
'category'
>
role/shadow/person
</multi_property>
<multi_property
id=
'base_category'
>
role
</multi_property>
</role>
</type_roles>
\ No newline at end of file
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Cloud%20Contract.xml
View file @
1874e049
<type_roles>
<role
id=
'Auditor'
>
<property
id=
'title'
>
Customer
</property>
<property
id=
'description'
>
Monovalued role
</property>
<property
id=
'base_category_script'
>
ERP5Type_getSecurityCategoryFromContent
</property>
<multi_property
id=
'categories'
>
local_role_group/user
</multi_property>
<multi_property
id=
'base_category'
>
destination_section
</multi_property>
</role>
<role
id=
'Assignor'
>
<property
id=
'title'
>
Group company
</property>
<multi_property
id=
'categories'
>
local_role_group/group
</multi_property>
...
...
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
View file @
1874e049
...
...
@@ -2316,20 +2316,35 @@ class TestCloudContractModule(TestSlapOSGroupRoleSecurityMixin):
module
=
self
.
portal
.
cloud_contract_module
self
.
changeOwnership
(
module
)
self
.
assertSecurityGroup
(
module
,
[
self
.
user_id
,
'G-COMPANY'
],
False
)
[
self
.
user_id
,
'G-COMPANY'
,
'R-MEMBER'
,
'R-SHADOW-PERSON'
],
False
)
self
.
assertRoles
(
module
,
'G-COMPANY'
,
[
'Author'
,
'Auditor'
])
self
.
assertRoles
(
module
,
self
.
user_id
,
[
'Owner'
])
class
TestCloudContract
(
TestSlapOSGroupRoleSecurityMixin
):
def
test_GroupCompany
(
self
):
tex
t
=
self
.
portal
.
cloud_contract_module
.
newContent
(
contrac
t
=
self
.
portal
.
cloud_contract_module
.
newContent
(
portal_type
=
'Cloud Contract'
)
self
.
assertSecurityGroup
(
tex
t
,
self
.
assertSecurityGroup
(
contrac
t
,
[
'G-COMPANY'
,
self
.
user_id
],
False
)
self
.
assertRoles
(
text
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
text
,
self
.
user_id
,
[
'Owner'
])
self
.
assertRoles
(
contract
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
contract
,
self
.
user_id
,
[
'Owner'
])
def
test_Customer
(
self
):
reference
=
'TESTPERSON-%s'
%
self
.
generateNewId
()
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
reference
=
reference
)
contract
=
self
.
portal
.
cloud_contract_module
.
newContent
(
portal_type
=
'Cloud Contract'
,
destination_section_value
=
person
,
)
contract
.
updateLocalRolesOnSecurityGroups
()
self
.
assertSecurityGroup
(
contract
,
[
'G-COMPANY'
,
person
.
getUserId
(),
self
.
user_id
],
False
)
self
.
assertRoles
(
contract
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
contract
,
person
.
getUserId
(),
[
'Auditor'
])
self
.
assertRoles
(
contract
,
self
.
user_id
,
[
'Owner'
])
class
TestUpgradeDecisionModule
(
TestSlapOSGroupRoleSecurityMixin
):
def
test
(
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