mirror of https://github.com/apache/cloudstack.git
bug 11525: cloudStack 2.2 UI - Domain Admin can only edit/delete/copy/download his own template just like a user.
This commit is contained in:
parent
d509c777a6
commit
4557b5d54e
|
|
@ -446,7 +446,8 @@ function isoJsonToDetailsTab() {
|
|||
var noAvailableActions = true;
|
||||
|
||||
// "Edit ISO", "Copy ISO"
|
||||
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))
|
||||
if ((isAdmin() == false && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account)) //if neither root-admin, nor item owner
|
||||
|| (jsonObj.isready == false)
|
||||
|| (jsonObj.domainid == 1 && jsonObj.account == "system")
|
||||
) {
|
||||
|
|
@ -463,7 +464,8 @@ function isoJsonToDetailsTab() {
|
|||
// "Create VM"
|
||||
// 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))
|
||||
//if (((isUser() && jsonObj.ispublic == true && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account))
|
||||
if (((isAdmin() == false && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account)) //if neither root-admin, nor item owner
|
||||
|| jsonObj.isready == false)
|
||||
|| (jsonObj.bootable == false)
|
||||
|| (jsonObj.domainid == 1 && jsonObj.account == "system")
|
||||
|
|
@ -477,7 +479,8 @@ function isoJsonToDetailsTab() {
|
|||
*/
|
||||
|
||||
// "Download ISO"
|
||||
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)))
|
||||
if (((isAdmin() == false && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account))) //if neither root-admin, nor item owner
|
||||
|| (jsonObj.isready == false)
|
||||
|| (jsonObj.domainid == 1 && jsonObj.account == "system")
|
||||
) {
|
||||
|
|
@ -489,7 +492,8 @@ function isoJsonToDetailsTab() {
|
|||
}
|
||||
|
||||
// "Delete ISO"
|
||||
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)))
|
||||
if (((isAdmin() == false && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account))) //if neither root-admin, nor item owner
|
||||
|| (jsonObj.isready == false && jsonObj.status != null && jsonObj.status.indexOf("Downloaded") != -1)
|
||||
|| (jsonObj.domainid == 1 && jsonObj.account == "system")
|
||||
) {
|
||||
|
|
|
|||
|
|
@ -478,7 +478,9 @@ function templateJsonToDetailsTab() {
|
|||
var noAvailableActions = true;
|
||||
|
||||
// "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))
|
||||
if ((isAdmin() == false && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account)) //if neither root-admin, nor item owner
|
||||
|| jsonObj.templatetype == "SYSTEM" || jsonObj.isready == false) {
|
||||
//do nothing
|
||||
}
|
||||
else {
|
||||
|
|
@ -493,7 +495,8 @@ function templateJsonToDetailsTab() {
|
|||
}
|
||||
|
||||
// "Download 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)))
|
||||
if (((isAdmin() == false && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account))) //if neither root-admin, nor item owner
|
||||
|| (jsonObj.isready == false) || jsonObj.templatetype == "SYSTEM") {
|
||||
//do nothing
|
||||
}
|
||||
|
|
@ -503,7 +506,8 @@ function templateJsonToDetailsTab() {
|
|||
}
|
||||
|
||||
// "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)))
|
||||
if (((isAdmin() == false && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account))) //if neither root-admin, nor item owner
|
||||
|| (jsonObj.isready == false && jsonObj.status != null && jsonObj.status.indexOf("Downloaded") != -1)
|
||||
|| jsonObj.templatetype == "SYSTEM") {
|
||||
//do nothing
|
||||
|
|
|
|||
Loading…
Reference in New Issue