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
18
Merge Requests
18
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
nexedi
slapos.core
Commits
34b9dc83
Commit
34b9dc83
authored
Jun 23, 2023
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_jio: Only show transfer action if the user is the owner
parent
0caecbf6
Changes
14
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
930 additions
and
9 deletions
+930
-9
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_compute_node_view_js.js
..._module/rjs_gadget_erp5_page_slap_compute_node_view_js.js
+3
-1
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_compute_node_view_js.xml
...module/rjs_gadget_erp5_page_slap_compute_node_view_js.xml
+2
-2
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_computer_network_view_js.js
...ule/rjs_gadget_erp5_page_slap_computer_network_view_js.js
+3
-1
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_computer_network_view_js.xml
...le/rjs_gadget_erp5_page_slap_computer_network_view_js.xml
+2
-2
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_instance_tree_view_js.js
...module/rjs_gadget_erp5_page_slap_instance_tree_view_js.js
+3
-1
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_instance_tree_view_js.xml
...odule/rjs_gadget_erp5_page_slap_instance_tree_view_js.xml
+2
-2
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/ComputeNode_viewAsHateoas.xml
...skins/slapos_hal_json_style/ComputeNode_viewAsHateoas.xml
+1
-0
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/ComputeNode_viewAsHateoas/my_is_owner.xml
..._hal_json_style/ComputeNode_viewAsHateoas/my_is_owner.xml
+279
-0
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/ComputerNetwork_viewAsHateoas.xml
...s/slapos_hal_json_style/ComputerNetwork_viewAsHateoas.xml
+1
-0
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/ComputerNetwork_viewAsHateoas/my_is_owner.xml
..._json_style/ComputerNetwork_viewAsHateoas/my_is_owner.xml
+279
-0
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Document_isRequesterOrOwner.py
...kins/slapos_hal_json_style/Document_isRequesterOrOwner.py
+13
-0
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Document_isRequesterOrOwner.xml
...ins/slapos_hal_json_style/Document_isRequesterOrOwner.xml
+62
-0
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/InstanceTree_viewAsHateoas.xml
...kins/slapos_hal_json_style/InstanceTree_viewAsHateoas.xml
+1
-0
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/InstanceTree_viewAsHateoas/my_is_owner.xml
...hal_json_style/InstanceTree_viewAsHateoas/my_is_owner.xml
+279
-0
No files found.
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_compute_node_view_js.js
View file @
34b9dc83
...
...
@@ -404,10 +404,12 @@
request_certificate_url
:
url_list
[
3
],
revoke_certificate_url
:
url_list
[
4
],
rss_url
:
url_list
[
5
],
transfer_url
:
url_list
[
6
],
selection_url
:
url_list
[
7
],
save_action
:
true
};
if
(
gadget
.
state
.
doc
.
is_owner
!==
undefined
)
{
header_dict
.
transfer_url
=
url_list
[
6
];
}
if
(
!
gadget
.
state
.
editable
)
{
header_dict
.
edit_content
=
url_list
[
0
];
}
...
...
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_compute_node_view_js.xml
View file @
34b9dc83
...
...
@@ -267,7 +267,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
1008.
49947.49157.41540
</string>
</value>
<value>
<string>
1008.
51160.9059.61542
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -287,7 +287,7 @@
</tuple>
<state>
<tuple>
<float>
168
5554088.09
</float>
<float>
168
7464494.14
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_computer_network_view_js.js
View file @
34b9dc83
...
...
@@ -244,9 +244,11 @@
selection_url
:
url_list
[
1
],
page_title
:
page_title_translation
+
"
:
"
+
gadget
.
state
.
doc
.
title
,
delete_url
:
url_list
[
2
],
transfer_url
:
url_list
[
3
],
save_action
:
true
};
if
(
gadget
.
state
.
doc
.
is_owner
!==
undefined
)
{
header_dict
.
transfer_url
=
url_list
[
3
];
}
if
(
!
gadget
.
state
.
editable
)
{
header_dict
.
edit_content
=
url_list
[
0
];
}
...
...
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_computer_network_view_js.xml
View file @
34b9dc83
...
...
@@ -238,7 +238,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
100
8.49948.50158.41267
</string>
</value>
<value>
<string>
100
9.17464.55631.39321
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -258,7 +258,7 @@
</tuple>
<state>
<tuple>
<float>
168
5554128.59
</float>
<float>
168
7465625.96
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_instance_tree_view_js.js
View file @
34b9dc83
...
...
@@ -523,9 +523,11 @@
destroy_url
:
url_list
[
4
],
rss_url
:
url_list
[
5
],
selection_url
:
url_list
[
6
],
transfer_url
:
url_list
[
7
],
save_action
:
true
};
if
(
gadget
.
state
.
doc
.
is_owner
!==
undefined
)
{
header_dict
.
transfer_url
=
url_list
[
7
];
}
if
(
gadget
.
state
.
doc
.
slap_state
===
"
start_requested
"
)
{
header_dict
.
stop_url
=
url_list
[
3
];
}
...
...
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_instance_tree_view_js.xml
View file @
34b9dc83
...
...
@@ -238,7 +238,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
1008.
49946.40563.64597
</string>
</value>
<value>
<string>
1008.
51163.7897.31249
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -258,7 +258,7 @@
</tuple>
<state>
<tuple>
<float>
168
5554267.16
</float>
<float>
168
7459175.1
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/ComputeNode_viewAsHateoas.xml
View file @
34b9dc83
...
...
@@ -108,6 +108,7 @@
<string>
my_monitor_scope
</string>
<string>
my_upgrade_scope
</string>
<string>
my_source_section_title
</string>
<string>
my_is_owner
</string>
</list>
</value>
</item>
...
...
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/ComputeNode_viewAsHateoas/my_is_owner.xml
0 → 100644
View file @
34b9dc83
This diff is collapsed.
Click to expand it.
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/ComputerNetwork_viewAsHateoas.xml
View file @
34b9dc83
...
...
@@ -102,6 +102,7 @@
<string>
my_news
</string>
<string>
my_source_project_title
</string>
<string>
my_source_section_title
</string>
<string>
my_is_owner
</string>
</list>
</value>
</item>
...
...
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/ComputerNetwork_viewAsHateoas/my_is_owner.xml
0 → 100644
View file @
34b9dc83
This diff is collapsed.
Click to expand it.
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Document_isRequesterOrOwner.py
0 → 100644
View file @
34b9dc83
portal
=
context
.
getPortalObject
()
user
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
if
user
is
None
:
return
portal_type
=
context
.
getPortalType
()
if
portal_type
in
[
"Compute Node"
,
"Computer Network"
]:
return
user
.
getRelativeUrl
()
==
context
.
getSourceAdministration
()
if
portal_type
==
"Instance Tree"
:
return
user
.
getRelativeUrl
()
==
context
.
getDestinationSection
()
raise
ValueError
(
"Unsupported Type"
)
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Document_isRequesterOrOwner.xml
0 → 100644
View file @
34b9dc83
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"_reconstructor"
module=
"copy_reg"
/>
</klass>
<tuple>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
<global
name=
"object"
module=
"__builtin__"
/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Document_isRequesterOrOwner
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/InstanceTree_viewAsHateoas.xml
View file @
34b9dc83
...
...
@@ -115,6 +115,7 @@
<string>
my_source_title
</string>
<string>
my_list_image
</string>
<string>
my_fast_input_dict
</string>
<string>
my_is_owner
</string>
</list>
</value>
</item>
...
...
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/InstanceTree_viewAsHateoas/my_is_owner.xml
0 → 100644
View file @
34b9dc83
This diff is collapsed.
Click to expand it.
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