You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by je...@apache.org on 2012/11/16 00:50:47 UTC
git commit: CLOUDSTACK-495: cloudstack UI - template page - delete
template/ISO - fix a JS error "cloudStack.context.projects is null"
Updated Branches:
refs/heads/master 27fcb788e -> 57aeb17a5
CLOUDSTACK-495: cloudstack UI - template page - delete template/ISO - fix a JS error "cloudStack.context.projects is null"
Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/57aeb17a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/57aeb17a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/57aeb17a
Branch: refs/heads/master
Commit: 57aeb17a5f50e7f4a338a710635b7967ec489481
Parents: 27fcb78
Author: Jessica Wang <je...@citrix.com>
Authored: Thu Nov 15 15:50:01 2012 -0800
Committer: Jessica Wang <je...@citrix.com>
Committed: Thu Nov 15 15:50:01 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/57aeb17a/ui/scripts/templates.js
----------------------------------------------------------------------
diff --git a/ui/scripts/templates.js b/ui/scripts/templates.js
index c865d74..74511f0 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) && !(jsonObj.domainid == g_domainid && 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) && !(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.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) && !(jsonObj.domainid == g_domainid && 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) && !(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.status != null && jsonObj.status.indexOf("Downloaded") != -1)
|| (jsonObj.account == "system")
) {