Commit 34b9dc83 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_jio: Only show transfer action if the user is the owner

parent 0caecbf6
......@@ -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];
}
......
......@@ -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>1685554088.09</float>
<float>1687464494.14</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -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];
}
......
......@@ -238,7 +238,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1008.49948.50158.41267</string> </value>
<value> <string>1009.17464.55631.39321</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -258,7 +258,7 @@
</tuple>
<state>
<tuple>
<float>1685554128.59</float>
<float>1687465625.96</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -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];
}
......
......@@ -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>1685554267.16</float>
<float>1687459175.1</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -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>
......
......@@ -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>
......
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")
<?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>
......@@ -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>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment