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
Jérome Perrin
slapos.core
Commits
c7e7347f
Commit
c7e7347f
authored
Feb 10, 2021
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_erp5: Drop unecessary Security Roles Definitions
parent
eae4ba5a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
79 deletions
+18
-79
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Data%20Set%20Module.xml
..._erp5/PortalTypeRolesTemplateItem/Data%20Set%20Module.xml
+0
-7
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Document%20Module.xml
...os_erp5/PortalTypeRolesTemplateItem/Document%20Module.xml
+0
-7
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Image%20Module.xml
...lapos_erp5/PortalTypeRolesTemplateItem/Image%20Module.xml
+0
-7
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Invitation%20Token%20Module.xml
...rtalTypeRolesTemplateItem/Invitation%20Token%20Module.xml
+0
-6
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
...l_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
+18
-52
No files found.
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Data%20Set%20Module.xml
View file @
c7e7347f
...
...
@@ -5,11 +5,4 @@
<multi_property
id=
'category'
>
group/company
</multi_property>
<multi_property
id=
'base_category'
>
group
</multi_property>
</role>
<role
id=
'Author'
>
<property
id=
'title'
>
Security for Shacache (Author)
</property>
<multi_property
id=
'categories'
>
local_role_group/user
</multi_property>
<multi_property
id=
'category'
>
role/member
</multi_property>
<multi_property
id=
'category'
>
role/computer
</multi_property>
<multi_property
id=
'category'
>
role/instance
</multi_property>
</role>
</type_roles>
\ No newline at end of file
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Document%20Module.xml
View file @
c7e7347f
...
...
@@ -5,11 +5,4 @@
<multi_property
id=
'category'
>
group/company
</multi_property>
<multi_property
id=
'base_category'
>
group
</multi_property>
</role>
<role
id=
'Author'
>
<property
id=
'title'
>
Security for Shacache (Author)
</property>
<multi_property
id=
'categories'
>
local_role_group/user
</multi_property>
<multi_property
id=
'category'
>
role/member
</multi_property>
<multi_property
id=
'category'
>
role/computer
</multi_property>
<multi_property
id=
'category'
>
role/instance
</multi_property>
</role>
</type_roles>
\ No newline at end of file
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Image%20Module.xml
View file @
c7e7347f
...
...
@@ -5,11 +5,4 @@
<multi_property
id=
'category'
>
group/company
</multi_property>
<multi_property
id=
'base_category'
>
group
</multi_property>
</role>
<role
id=
'Author'
>
<property
id=
'title'
>
Security for Shacache (Author)
</property>
<multi_property
id=
'categories'
>
local_role_group/user
</multi_property>
<multi_property
id=
'category'
>
role/member
</multi_property>
<multi_property
id=
'category'
>
role/computer
</multi_property>
<multi_property
id=
'category'
>
role/instance
</multi_property>
</role>
</type_roles>
\ No newline at end of file
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Invitation%20Token%20Module.xml
View file @
c7e7347f
...
...
@@ -5,10 +5,4 @@
<multi_property
id=
'category'
>
group/company
</multi_property>
<multi_property
id=
'base_category'
>
group
</multi_property>
</role>
<role
id=
'Author'
>
<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>
</type_roles>
\ No newline at end of file
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
View file @
c7e7347f
...
...
@@ -324,11 +324,8 @@ class TestDataSet(TestSlapOSGroupRoleSecurityMixin):
data_set
.
updateLocalRolesOnSecurityGroups
()
self
.
assertSecurityGroup
(
data_set
,
[
self
.
user_id
,
'G-COMPANY'
,
'R-COMPUTER'
,
'R-INSTANCE'
,
'R-MEMBER'
],
[
self
.
user_id
,
'G-COMPANY'
],
False
)
self
.
assertRoles
(
data_set
,
'R-COMPUTER'
,
[
'Auditor'
])
self
.
assertRoles
(
data_set
,
'R-INSTANCE'
,
[
'Auditor'
])
self
.
assertRoles
(
data_set
,
'R-MEMBER'
,
[
'Auditor'
])
self
.
assertRoles
(
data_set
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
data_set
,
self
.
user_id
,
[
'Owner'
])
...
...
@@ -337,10 +334,7 @@ class TestDataSetModule(TestSlapOSGroupRoleSecurityMixin):
module
=
self
.
portal
.
data_set_module
self
.
changeOwnership
(
module
)
self
.
assertSecurityGroup
(
module
,
[
'G-COMPANY'
,
'R-COMPUTER'
,
'R-INSTANCE'
,
'R-MEMBER'
,
self
.
user_id
],
False
)
self
.
assertRoles
(
module
,
'R-COMPUTER'
,
[
'Author'
])
self
.
assertRoles
(
module
,
'R-INSTANCE'
,
[
'Author'
])
self
.
assertRoles
(
module
,
'R-MEMBER'
,
[
'Author'
])
[
'G-COMPANY'
,
self
.
user_id
],
False
)
self
.
assertRoles
(
module
,
'G-COMPANY'
,
[
'Author'
,
'Auditor'
])
self
.
assertRoles
(
module
,
self
.
user_id
,
[
'Owner'
])
...
...
@@ -349,38 +343,28 @@ class TestDocumentModule(TestSlapOSGroupRoleSecurityMixin):
module
=
self
.
portal
.
document_module
self
.
changeOwnership
(
module
)
self
.
assertSecurityGroup
(
module
,
[
'R-COMPUTER'
,
'R-INSTANCE'
,
'R-MEMBER'
,
self
.
user_id
,
'G-COMPANY'
],
False
)
self
.
assertRoles
(
module
,
'R-COMPUTER'
,
[
'Author'
])
self
.
assertRoles
(
module
,
'R-INSTANCE'
,
[
'Author'
])
self
.
assertRoles
(
module
,
'R-MEMBER'
,
[
'Author'
])
[
self
.
user_id
,
'G-COMPANY'
],
False
)
self
.
assertRoles
(
module
,
'G-COMPANY'
,
[
'Author'
,
'Auditor'
])
self
.
assertRoles
(
module
,
self
.
user_id
,
[
'Owner'
])
class
TestDrawing
(
TestSlapOSGroupRoleSecurityMixin
):
def
test
_SecurityForShacache
(
self
):
def
test
(
self
):
drawing
=
self
.
portal
.
document_module
.
newContent
(
portal_type
=
'Drawing'
)
drawing
.
updateLocalRolesOnSecurityGroups
()
self
.
assertSecurityGroup
(
drawing
,
[
'G-COMPANY'
,
self
.
user_id
,
'R-COMPUTER'
,
'R-INSTANCE'
,
'R-MEMBER'
],
False
)
self
.
assertRoles
(
drawing
,
'R-COMPUTER'
,
[
'Auditor'
])
self
.
assertRoles
(
drawing
,
'R-INSTANCE'
,
[
'Auditor'
])
self
.
assertRoles
(
drawing
,
'R-MEMBER'
,
[
'Auditor'
])
[
'G-COMPANY'
,
self
.
user_id
,],
False
)
self
.
assertRoles
(
drawing
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
drawing
,
self
.
user_id
,
[
'Owner'
])
class
TestFile
(
TestSlapOSGroupRoleSecurityMixin
):
def
test
_SecurityForShacache
(
self
):
def
test
(
self
):
file_
=
self
.
portal
.
document_module
.
newContent
(
portal_type
=
'File'
)
file_
.
updateLocalRolesOnSecurityGroups
()
self
.
assertSecurityGroup
(
file_
,
[
'G-COMPANY'
,
self
.
user_id
,
'R-COMPUTER'
,
'R-INSTANCE'
,
'R-MEMBER'
],
[
'G-COMPANY'
,
self
.
user_id
],
False
)
self
.
assertRoles
(
file_
,
'R-COMPUTER'
,
[
'Auditor'
])
self
.
assertRoles
(
file_
,
'R-INSTANCE'
,
[
'Auditor'
])
self
.
assertRoles
(
file_
,
'R-MEMBER'
,
[
'Auditor'
])
self
.
assertRoles
(
file_
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
file_
,
self
.
user_id
,
[
'Owner'
])
...
...
@@ -427,16 +411,13 @@ class TestHostingSubscriptionModule(TestSlapOSGroupRoleSecurityMixin):
self
.
assertRoles
(
module
,
self
.
user_id
,
[
'Owner'
])
class
TestImage
(
TestSlapOSGroupRoleSecurityMixin
):
def
test
_SecurityForShacache
(
self
):
def
test
(
self
):
image
=
self
.
portal
.
image_module
.
newContent
(
portal_type
=
'Image'
)
image
.
updateLocalRolesOnSecurityGroups
()
self
.
assertSecurityGroup
(
image
,
[
'G-COMPANY'
,
self
.
user_id
,
'R-COMPUTER'
,
'R-INSTANCE'
,
'R-MEMBER'
],
[
'G-COMPANY'
,
self
.
user_id
],
False
)
self
.
assertRoles
(
image
,
'R-COMPUTER'
,
[
'Auditor'
])
self
.
assertRoles
(
image
,
'R-INSTANCE'
,
[
'Auditor'
])
self
.
assertRoles
(
image
,
'R-MEMBER'
,
[
'Auditor'
])
self
.
assertRoles
(
image
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
image
,
self
.
user_id
,
[
'Owner'
])
...
...
@@ -539,16 +520,13 @@ class TestProject(TestSlapOSGroupRoleSecurityMixin):
self
.
assertRoles
(
project
,
self
.
user_id
,
[
'Owner'
,
'Assignee'
])
class
TestPDF
(
TestSlapOSGroupRoleSecurityMixin
):
def
test
_SecurityForShacache
(
self
):
def
test
(
self
):
pdf
=
self
.
portal
.
document_module
.
newContent
(
portal_type
=
'PDF'
)
pdf
.
updateLocalRolesOnSecurityGroups
()
self
.
assertSecurityGroup
(
pdf
,
[
'G-COMPANY'
,
self
.
user_id
,
'R-COMPUTER'
,
'R-INSTANCE'
,
'R-MEMBER'
],
[
'G-COMPANY'
,
self
.
user_id
],
False
)
self
.
assertRoles
(
pdf
,
'R-COMPUTER'
,
[
'Auditor'
])
self
.
assertRoles
(
pdf
,
'R-INSTANCE'
,
[
'Auditor'
])
self
.
assertRoles
(
pdf
,
'R-MEMBER'
,
[
'Auditor'
])
self
.
assertRoles
(
pdf
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
pdf
,
self
.
user_id
,
[
'Owner'
])
...
...
@@ -658,17 +636,14 @@ class TestPersonModule(TestSlapOSGroupRoleSecurityMixin):
self
.
assertRoles
(
module
,
self
.
user_id
,
[
'Owner'
])
class
TestPresentation
(
TestSlapOSGroupRoleSecurityMixin
):
def
test
_SecurityForShacache
(
self
):
def
test
(
self
):
presentation
=
self
.
portal
.
document_module
.
newContent
(
portal_type
=
'Presentation'
)
presentation
.
updateLocalRolesOnSecurityGroups
()
self
.
assertSecurityGroup
(
presentation
,
[
'G-COMPANY'
,
self
.
user_id
,
'R-COMPUTER'
,
'R-INSTANCE'
,
'R-MEMBER'
],
[
'G-COMPANY'
,
self
.
user_id
],
False
)
self
.
assertRoles
(
presentation
,
'R-COMPUTER'
,
[
'Auditor'
])
self
.
assertRoles
(
presentation
,
'R-INSTANCE'
,
[
'Auditor'
])
self
.
assertRoles
(
presentation
,
'R-MEMBER'
,
[
'Auditor'
])
self
.
assertRoles
(
presentation
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
presentation
,
self
.
user_id
,
[
'Owner'
])
...
...
@@ -893,32 +868,26 @@ class TestSoftwareReleaseModule(TestSlapOSGroupRoleSecurityMixin):
self
.
assertRoles
(
module
,
self
.
user_id
,
[
'Owner'
])
class
TestSpreadsheet
(
TestSlapOSGroupRoleSecurityMixin
):
def
test
_SecurityForShacache
(
self
):
def
test
(
self
):
spreadsheet
=
self
.
portal
.
document_module
.
newContent
(
portal_type
=
'Spreadsheet'
)
spreadsheet
.
updateLocalRolesOnSecurityGroups
()
self
.
assertSecurityGroup
(
spreadsheet
,
[
'G-COMPANY'
,
self
.
user_id
,
'R-COMPUTER'
,
'R-INSTANCE'
,
'R-MEMBER'
],
[
'G-COMPANY'
,
self
.
user_id
],
False
)
self
.
assertRoles
(
spreadsheet
,
'R-COMPUTER'
,
[
'Auditor'
])
self
.
assertRoles
(
spreadsheet
,
'R-INSTANCE'
,
[
'Auditor'
])
self
.
assertRoles
(
spreadsheet
,
'R-MEMBER'
,
[
'Auditor'
])
self
.
assertRoles
(
spreadsheet
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
spreadsheet
,
self
.
user_id
,
[
'Owner'
])
class
TestText
(
TestSlapOSGroupRoleSecurityMixin
):
def
test
_SecurityForShacache
(
self
):
def
test
(
self
):
text
=
self
.
portal
.
document_module
.
newContent
(
portal_type
=
'Text'
)
text
.
updateLocalRolesOnSecurityGroups
()
self
.
assertSecurityGroup
(
text
,
[
'G-COMPANY'
,
self
.
user_id
,
'R-COMPUTER'
,
'R-INSTANCE'
,
'R-MEMBER'
],
[
'G-COMPANY'
,
self
.
user_id
],
False
)
self
.
assertRoles
(
text
,
'R-COMPUTER'
,
[
'Auditor'
])
self
.
assertRoles
(
text
,
'R-INSTANCE'
,
[
'Auditor'
])
self
.
assertRoles
(
text
,
'R-MEMBER'
,
[
'Auditor'
])
self
.
assertRoles
(
text
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
text
,
self
.
user_id
,
[
'Owner'
])
...
...
@@ -927,10 +896,7 @@ class TestContributionTool(TestSlapOSGroupRoleSecurityMixin):
module
=
self
.
portal
.
portal_contributions
self
.
changeOwnership
(
module
)
self
.
assertSecurityGroup
(
module
,
[
'R-COMPUTER'
,
'R-INSTANCE'
,
'R-MEMBER'
,
self
.
user_id
,
'G-COMPANY'
],
True
)
self
.
assertRoles
(
module
,
'R-COMPUTER'
,
[
'Author'
])
self
.
assertRoles
(
module
,
'R-INSTANCE'
,
[
'Author'
])
self
.
assertRoles
(
module
,
'R-MEMBER'
,
[
'Author'
])
[
self
.
user_id
,
'G-COMPANY'
],
True
)
self
.
assertRoles
(
module
,
'G-COMPANY'
,
[
'Author'
,
'Auditor'
])
self
.
assertRoles
(
module
,
self
.
user_id
,
[
'Owner'
])
...
...
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