Updated Branches: refs/heads/master 46cce3a89 -> 126b4b579
CS-16483: cloudstack UI - template page, ISO page - delete action is available if template/ISO and the login user is under the same project. Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/126b4b57 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/126b4b57 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/126b4b57 Branch: refs/heads/master Commit: 126b4b57903f55c51a8272e0adae324bf5cdeb37 Parents: 46cce3a Author: Jessica Wang <[email protected]> Authored: Mon Nov 5 16:32:14 2012 -0800 Committer: Jessica Wang <[email protected]> Committed: Mon Nov 5 16:34:07 2012 -0800 ---------------------------------------------------------------------- ui/scripts/templates.js | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/126b4b57/ui/scripts/templates.js ---------------------------------------------------------------------- diff --git a/ui/scripts/templates.js b/ui/scripts/templates.js index f6c209a..c865d74 100644 --- a/ui/scripts/templates.js +++ b/ui/scripts/templates.js @@ -1428,7 +1428,7 @@ // "Delete Template" //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 + if (((isAdmin() == false && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account) && !(jsonObj.domainid == g_domainid && jsonObj.projectid == cloudStack.context.projects[0].id))) //if neither root-admin, nor the same account, nor the same project || (jsonObj.isready == false && jsonObj.status != null && jsonObj.status.indexOf("Downloaded") != -1) || (jsonObj.account == "system")) { //do nothing @@ -1487,7 +1487,7 @@ // "Delete ISO" //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 + if (((isAdmin() == false && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account) && !(jsonObj.domainid == g_domainid && jsonObj.projectid == cloudStack.context.projects[0].id))) //if neither root-admin, nor the same account, nor the same project || (jsonObj.isready == false && jsonObj.status != null && jsonObj.status.indexOf("Downloaded") != -1) || (jsonObj.account == "system") ) {
