mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
bug 7535: ISO page - hide "Download ISO" option for non-admin user.
This commit is contained in:
parent
b4029d0a49
commit
291a9669e7
@ -317,9 +317,9 @@ function isoJsonToDetailsTab() {
|
|||||||
$actionMenu.find("#action_list").empty();
|
$actionMenu.find("#action_list").empty();
|
||||||
var noAvailableActions = true;
|
var noAvailableActions = true;
|
||||||
|
|
||||||
// "Edit", "Copy", "Create VM"
|
// "Edit ISO", "Copy ISO"
|
||||||
if ((isUser() && jsonObj.ispublic == true && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account)) || jsonObj.isready == false) {
|
if ((isUser() && jsonObj.ispublic == true && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account)) || jsonObj.isready == false) {
|
||||||
//nothing happens
|
//do nothing
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
buildActionLinkForTab("Edit ISO", isoActionMap, $actionMenu, $midmenuItem1, $thisTab);
|
buildActionLinkForTab("Edit ISO", isoActionMap, $actionMenu, $midmenuItem1, $thisTab);
|
||||||
@ -329,7 +329,7 @@ function isoJsonToDetailsTab() {
|
|||||||
buildActionLinkForTab("Copy ISO", isoActionMap, $actionMenu, $midmenuItem1, $thisTab);
|
buildActionLinkForTab("Copy ISO", isoActionMap, $actionMenu, $midmenuItem1, $thisTab);
|
||||||
}
|
}
|
||||||
|
|
||||||
// "Create VM"
|
// "Create VM"
|
||||||
// Commenting this out for Beta2 as it does not support the new network.
|
// Commenting this out for Beta2 as it does not support the new network.
|
||||||
/*
|
/*
|
||||||
if (((isUser() && jsonObj.ispublic == true && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account)) || jsonObj.isready == false) || (jsonObj.bootable == false)) {
|
if (((isUser() && jsonObj.ispublic == true && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account)) || jsonObj.isready == false) || (jsonObj.bootable == false)) {
|
||||||
@ -340,16 +340,15 @@ function isoJsonToDetailsTab() {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// "Delete"
|
// "Download ISO", "Delete ISO"
|
||||||
if (((isUser() && jsonObj.ispublic == true && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account))) || (jsonObj.isready == false && jsonObj.isostatus != null && jsonObj.isostatus.indexOf("% Downloaded") != -1)) {
|
if (((isUser() && jsonObj.ispublic == true && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account))) || (jsonObj.isready == false && jsonObj.isostatus != null && jsonObj.isostatus.indexOf("% Downloaded") != -1)) {
|
||||||
|
//do nothing
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
buildActionLinkForTab("Download ISO", isoActionMap, $actionMenu, $midmenuItem1, $thisTab);
|
||||||
buildActionLinkForTab("Delete ISO", isoActionMap, $actionMenu, $midmenuItem1, $thisTab);
|
buildActionLinkForTab("Delete ISO", isoActionMap, $actionMenu, $midmenuItem1, $thisTab);
|
||||||
noAvailableActions = false;
|
noAvailableActions = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
buildActionLinkForTab("Download ISO", isoActionMap, $actionMenu, $midmenuItem1, $thisTab);
|
|
||||||
noAvailableActions = false;
|
|
||||||
|
|
||||||
// no available actions
|
// no available actions
|
||||||
if(noAvailableActions == true) {
|
if(noAvailableActions == true) {
|
||||||
|
|||||||
@ -319,26 +319,28 @@ function templateJsonToDetailsTab() {
|
|||||||
$actionMenu.find("#action_list").empty();
|
$actionMenu.find("#action_list").empty();
|
||||||
var noAvailableActions = true;
|
var noAvailableActions = true;
|
||||||
|
|
||||||
// action Edit, Copy, Create VM
|
// "Edit Template", "Copy Template", "Create VM"
|
||||||
if ((isUser() && jsonObj.ispublic == true && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account)) || jsonObj.templatetype == "SYSTEM" || jsonObj.isready == false) {
|
if ((isUser() && jsonObj.ispublic == true && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account)) || jsonObj.templatetype == "SYSTEM" || jsonObj.isready == false) {
|
||||||
//$("#edit_button").hide();
|
//do nothing
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
buildActionLinkForTab("Edit Template", templateActionMap, $actionMenu, $midmenuItem1, $thisTab);
|
buildActionLinkForTab("Edit Template", templateActionMap, $actionMenu, $midmenuItem1, $thisTab);
|
||||||
//$("#edit_button").show();
|
|
||||||
buildActionLinkForTab("Copy Template", templateActionMap, $actionMenu, $midmenuItem1, $thisTab);
|
buildActionLinkForTab("Copy Template", templateActionMap, $actionMenu, $midmenuItem1, $thisTab);
|
||||||
|
|
||||||
// For Beta2, this simply doesn't work without a network.
|
// For Beta2, this simply doesn't work without a network.
|
||||||
//buildActionLinkForTab("Create VM", templateActionMap, $actionMenu, $midmenuItem1, $thisTab);
|
//buildActionLinkForTab("Create VM", templateActionMap, $actionMenu, $midmenuItem1, $thisTab);
|
||||||
buildActionLinkForTab("Download Template", templateActionMap, $actionMenu, $midmenuItem1, $thisTab);
|
|
||||||
noAvailableActions = false;
|
noAvailableActions = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// action Delete
|
// "Download Template", "Delete Template"
|
||||||
if (((isUser() && jsonObj.ispublic == true && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account)))
|
if (((isUser() && jsonObj.ispublic == true && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account)))
|
||||||
|| (jsonObj.isready == false && jsonObj.templatestatus != null && jsonObj.templatestatus.indexOf("% Downloaded") != -1) || jsonObj.templatetype == "SYSTEM") {
|
|| (jsonObj.isready == false && jsonObj.templatestatus != null && jsonObj.templatestatus.indexOf("% Downloaded") != -1) || jsonObj.templatetype == "SYSTEM") {
|
||||||
//template.find("#template_delete_container").hide();
|
//do nothing
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
buildActionLinkForTab("Download Template", templateActionMap, $actionMenu, $midmenuItem1, $thisTab);
|
||||||
buildActionLinkForTab("Delete Template", templateActionMap, $actionMenu, $midmenuItem1, $thisTab);
|
buildActionLinkForTab("Delete Template", templateActionMap, $actionMenu, $midmenuItem1, $thisTab);
|
||||||
noAvailableActions = false;
|
noAvailableActions = false;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user