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
0
Merge Requests
0
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
Rafael Monnerat
slapos.core
Commits
3e947793
Commit
3e947793
authored
Dec 11, 2024
by
Rafael Monnerat
👻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_erp5: Reimplement (and speed up) security to use ERP5User_getUserSecurityCategoryValueList
parent
efb0f29f
Pipeline
#38500
failed with stage
in 0 seconds
Changes
5
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
57 deletions
+12
-57
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_core/ERP5Type_getSecurityCategoryMapping.py
..._skins/slapos_core/ERP5Type_getSecurityCategoryMapping.py
+0
-26
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_core/ERP5Type_getSoftwareInstanceSecurityCategory.xml
...pos_core/ERP5Type_getSoftwareInstanceSecurityCategory.xml
+0
-28
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_core/ERP5User_getSlapOSUserSecurityCategoryValue.xml
...apos_core/ERP5User_getSlapOSUserSecurityCategoryValue.xml
+2
-2
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_core/ERP5User_getUserSecurityCategoryValueList.py
.../slapos_core/ERP5User_getUserSecurityCategoryValueList.py
+9
-0
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_core/ERP5User_getUserSecurityCategoryValueList.xml
...slapos_core/ERP5User_getUserSecurityCategoryValueList.xml
+1
-1
No files found.
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_core/ERP5Type_getSecurityCategoryMapping.py
deleted
100644 → 0
View file @
efb0f29f
"""
Core security script - defines the way to get security groups of the current user.
WARNING: providing such script in erp5_dms could be dangerous
if this conflicts with an existing production site which uses
deprecated ERP5Type_asSecurityGroupIdList
"""
return
(
# Person security
(
'ERP5Type_getSecurityCategoryFromAssignment'
,
[
'function'
]),
(
'ERP5Type_getSecurityCategoryFromAssignmentParent'
,
[
'function'
]),
# XXX TODO check that only validated project are used
(
'ERP5Type_getSecurityCategoryFromAssignment'
,
[
'destination_project'
]),
(
'ERP5Type_getSecurityCategoryFromAssignment'
,
[
'destination_project'
,
'function'
]),
# Compute Node security
(
'ERP5Type_getComputeNodeSecurityCategory'
,
[
'role'
]),
# Instance security
(
'ERP5Type_getSoftwareInstanceSecurityCategory'
,
[
'role'
]),
(
'ERP5Type_getSoftwareInstanceSecurityCategory'
,
[
'destination_project'
]),
(
'ERP5Type_getSoftwareInstanceSecurityCategory'
,
[
'destination_project'
,
'role'
]),
(
'ERP5Type_getSoftwareInstanceSecurityCategory'
,
[
'aggregate'
]),
)
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_core/ERP5Type_getSoftwareInstanceSecurityCategory.xml
deleted
100644 → 0
View file @
efb0f29f
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ExternalMethod"
module=
"Products.ExternalMethod.ExternalMethod"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_function
</string>
</key>
<value>
<string>
getSoftwareInstanceSecurityCategory
</string>
</value>
</item>
<item>
<key>
<string>
_module
</string>
</key>
<value>
<string>
SlapOSSecurity
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
ERP5Type_getSoftwareInstanceSecurityCategory
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_core/ERP5
Type_getComputeNodeSecurityCategory
.xml
→
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_core/ERP5
User_getSlapOSUserSecurityCategoryValue
.xml
View file @
3e947793
...
...
@@ -8,7 +8,7 @@
<dictionary>
<item>
<key>
<string>
_function
</string>
</key>
<value>
<string>
get
ComputeNodeSecurityCategory
</string>
</value>
<value>
<string>
get
SlapOSUserSecurityCategoryValue
</string>
</value>
</item>
<item>
<key>
<string>
_module
</string>
</key>
...
...
@@ -16,7 +16,7 @@
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
ERP5
Type_getComputeNodeSecurityCategory
</string>
</value>
<value>
<string>
ERP5
User_getSlapOSUserSecurityCategoryValue
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
...
...
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_core/ERP5User_getUserSecurityCategoryValueList.py
0 → 100644
View file @
3e947793
if
context
.
getPortalType
()
==
'Person'
:
return
context
.
ERP5User_getSecurityCategoryValueFromAssignment
(
rule_dict
=
{
(
'function'
,):
((),
(
'function'
,)),
(
'destination_project'
,):
((),
),
(
'destination_project'
,
'function'
):
((),
),
},
)
return
context
.
ERP5User_getSlapOSUserSecurityCategoryValue
()
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_core/ERP5
Type_getSecurityCategoryMapping
.xml
→
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_core/ERP5
User_getUserSecurityCategoryValueList
.xml
View file @
3e947793
...
...
@@ -54,7 +54,7 @@
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
ERP5
Type_getSecurityCategoryMapping
</string>
</value>
<value>
<string>
ERP5
User_getUserSecurityCategoryValueList
</string>
</value>
</item>
</dictionary>
</pickle>
...
...
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