Updated Branches: refs/heads/master e11355602 -> 163779200
CLOUDSTACK-544: cloudstack UI - template page, ISO page - edit, copy, download 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/16377920 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/16377920 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/16377920 Branch: refs/heads/master Commit: 163779200fbc37963d2890902f3feebbb2cb1231 Parents: e113556 Author: Jessica Wang <[email protected]> Authored: Mon Nov 26 16:13:01 2012 -0800 Committer: Jessica Wang <[email protected]> Committed: Mon Nov 26 16:13:01 2012 -0800 ---------------------------------------------------------------------- ui/scripts/templates.js | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/16377920/ui/scripts/templates.js ---------------------------------------------------------------------- diff --git a/ui/scripts/templates.js b/ui/scripts/templates.js index 74511f0..96c00b7 100644 --- a/ui/scripts/templates.js +++ b/ui/scripts/templates.js @@ -1404,7 +1404,7 @@ var allowedActions = []; // "Edit Template", "Copy Template", "Create VM" - 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 && cloudStack.context.projects && jsonObj.projectid == cloudStack.context.projects[0].id)) //if neither root-admin, nor the same account, nor the same project || jsonObj.templatetype == "SYSTEM" || jsonObj.isready == false) { //do nothing } @@ -1418,7 +1418,7 @@ } // "Download Template" - 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 && cloudStack.context.projects && jsonObj.projectid == cloudStack.context.projects[0].id))) //if neither root-admin, nor the same account, nor the same project || (jsonObj.isready == false) || jsonObj.templatetype == "SYSTEM") { //do nothing } @@ -1444,7 +1444,7 @@ var jsonObj = args.context.item; var allowedActions = []; - 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 && cloudStack.context.projects && jsonObj.projectid == cloudStack.context.projects[0].id)) //if neither root-admin, nor the same account, nor the same project || (jsonObj.isready == false) || (jsonObj.domainid == 1 && jsonObj.account == "system") ) { @@ -1460,7 +1460,7 @@ // "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) && !(jsonObj.domainid == g_domainid && cloudStack.context.projects && jsonObj.projectid == cloudStack.context.projects[0].id)) //if neither root-admin, nor the same account, nor the same project if (((isAdmin() == false && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account)) //if neither root-admin, nor item owner || jsonObj.isready == false) || (jsonObj.bootable == false) @@ -1475,7 +1475,7 @@ // "Download 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 && cloudStack.context.projects && jsonObj.projectid == cloudStack.context.projects[0].id))) //if neither root-admin, nor the same account, nor the same project || (jsonObj.isready == false) || (jsonObj.domainid == 1 && jsonObj.account == "system") ) {
