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
Lisa Casino
slapos.core
Commits
fd0b8d89
Commit
fd0b8d89
authored
Apr 25, 2019
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: Fix bang propagation as Slave Instance
parent
c6fbdfb2
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
13 deletions
+48
-13
master/bt5/slapos_cloud/ExtensionTemplateItem/portal_components/extension.erp5.SlapOSCloud.py
...plateItem/portal_components/extension.erp5.SlapOSCloud.py
+10
-10
master/bt5/slapos_cloud/ExtensionTemplateItem/portal_components/extension.erp5.SlapOSCloud.xml
...lateItem/portal_components/extension.erp5.SlapOSCloud.xml
+30
-3
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/instance_slap_interface_workflow/scripts/Instance_checkConsistency.xml
..._interface_workflow/scripts/Instance_checkConsistency.xml
+8
-0
No files found.
master/bt5/slapos_cloud/ExtensionTemplateItem/portal_components/extension.erp5.SlapOSCloud.py
View file @
fd0b8d89
...
...
@@ -27,7 +27,9 @@
from
AccessControl.SecurityManagement
import
getSecurityManager
,
\
setSecurityManager
,
newSecurityManager
from
Products
import
ERP5Security
from
Products.ERP5Type.UnrestrictedMethod
import
super_user
def
SoftwareInstance_bangAsSelf
(
self
,
relative_url
=
None
,
reference
=
None
,
comment
=
None
):
...
...
@@ -37,21 +39,19 @@ def SoftwareInstance_bangAsSelf(self, relative_url=None, reference=None,
raise
TypeError
(
'relative_url has to be defined'
)
if
reference
is
None
:
raise
TypeError
(
'reference has to be defined'
)
# micro security: can caller access software instance?
software_instance
=
self
.
restrictedTraverse
(
relative_url
)
sm
=
getSecurityManager
()
if
(
software_instance
.
getPortalType
()
==
"Slave Instance"
)
and
\
(
software_instance
.
getReference
()
==
reference
):
# XXX There is no account for Slave Instance
user_id
=
ERP5Security
.
SUPER_USER
else
:
user_id
=
software_instance
.
getUserId
()
with
super_user
():
software_instance
.
bang
(
bang_tree
=
True
,
comment
=
comment
)
return
newSecurityManager
(
None
,
self
.
getPortalObject
().
acl_users
.
getUserById
(
user_id
))
sm
=
getSecurityManager
()
user_id
=
software_instance
.
getUserId
()
newSecurityManager
(
None
,
self
.
getPortalObject
().
acl_users
.
getUserById
(
user_id
))
try
:
software_instance
.
bang
(
bang_tree
=
True
,
comment
=
comment
)
finally
:
# Restore the original user.
setSecurityManager
(
sm
)
\ No newline at end of file
master/bt5/slapos_cloud/ExtensionTemplateItem/portal_components/extension.erp5.SlapOSCloud.xml
View file @
fd0b8d89
...
...
@@ -6,10 +6,22 @@
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
SlapOSCloud
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
extension.erp5.SlapOSCloud
</string>
</value>
...
...
@@ -43,13 +55,28 @@
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
I
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
...
...
@@ -62,7 +89,7 @@
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
Q
=
</string>
</persistent>
</value>
</item>
</dictionary>
...
...
@@ -71,7 +98,7 @@
</dictionary>
</pickle>
</record>
<record
id=
"
3"
aka=
"AAAAAAAAAAM
="
>
<record
id=
"
4"
aka=
"AAAAAAAAAAQ
="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
...
...
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/instance_slap_interface_workflow/scripts/Instance_checkConsistency.xml
View file @
fd0b8d89
...
...
@@ -52,6 +52,14 @@
<key>
<string>
_params
</string>
</key>
<value>
<string>
state_change
</string>
</value>
</item>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
<value>
<tuple>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Instance_checkConsistency
</string>
</value>
...
...
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