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
c07d4339
Commit
c07d4339
authored
Nov 08, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch to instance user before doing bang.
parent
fcd9bd97
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
3 deletions
+46
-3
master/bt5/vifib_erp5/ExtensionTemplateItem/VifibSecurity.py
master/bt5/vifib_erp5/ExtensionTemplateItem/VifibSecurity.py
+14
-0
master/bt5/vifib_erp5/SkinTemplateItem/portal_skins/vifib_core/SoftwareInstance_bangAsSelf.xml
...m/portal_skins/vifib_core/SoftwareInstance_bangAsSelf.xml
+28
-0
master/bt5/vifib_erp5/bt/revision
master/bt5/vifib_erp5/bt/revision
+1
-1
master/bt5/vifib_slap/WorkflowTemplateItem/portal_workflow/computer_slap_interface_workflow/scripts/Computer_reportBang.xml
...r_slap_interface_workflow/scripts/Computer_reportBang.xml
+2
-1
master/bt5/vifib_slap/bt/revision
master/bt5/vifib_slap/bt/revision
+1
-1
No files found.
master/bt5/vifib_erp5/ExtensionTemplateItem/VifibSecurity.py
View file @
c07d4339
...
...
@@ -61,6 +61,20 @@ def restrictMethodAsShadowUser(self, open_order=None, callable_object=None,
# Restore the original user.
setSecurityManager
(
sm
)
def
SoftwareInstance_bangAsSelf
(
self
,
relative_url
=
None
,
reference
=
None
,
comment
=
None
):
"""Call bang on self."""
# micro security: can caller access software instance?
software_instance
=
self
.
restrictedTraverse
(
relative_url
)
sm
=
getSecurityManager
()
newSecurityManager
(
None
,
self
.
getPortalObject
().
acl_users
.
getUserById
(
reference
))
try
:
software_instance
.
reportComputerPartitionBang
(
comment
=
comment
)
finally
:
# Restore the original user.
setSecurityManager
(
sm
)
def
getComputerSecurityCategory
(
self
,
base_category_list
,
user_name
,
object
,
portal_type
):
"""
...
...
master/bt5/vifib_erp5/SkinTemplateItem/portal_skins/vifib_core/SoftwareInstance_bangAsSelf.xml
0 → 100644
View file @
c07d4339
<?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>
SoftwareInstance_bangAsSelf
</string>
</value>
</item>
<item>
<key>
<string>
_module
</string>
</key>
<value>
<string>
VifibSecurity
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
SoftwareInstance_bangAsSelf
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_erp5/bt/revision
View file @
c07d4339
289
\ No newline at end of file
290
\ No newline at end of file
master/bt5/vifib_slap/WorkflowTemplateItem/portal_workflow/computer_slap_interface_workflow/scripts/Computer_reportBang.xml
View file @
c07d4339
...
...
@@ -55,7 +55,8 @@ for computer_partition in [x for x in computer.contentValues(portal_type=\'Compu
# raises ValueError in case of no packing list found, left as is\n
packing_list_line = computer_partition.Item_getInstancePackingListLine()\n
software_instance = packing_list_line.getAggregateValue(portal_type=\'Software Instance\')\n
software_instance.activate().reportComputerPartitionBang(comment=state_change.kwargs.get(\'comment\', \'\'))\n
software_instance.activate().SoftwareInstance_bangAsSelf(reference=software_instance.getReference(),\n
comment=state_change.kwargs.get(\'comment\', \'\'))\n
</string>
</value>
</item>
<item>
...
...
master/bt5/vifib_slap/bt/revision
View file @
c07d4339
440
\ No newline at end of file
441
\ No newline at end of file
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