From 700dacf0b91119a3da1479a731545aebe2a76d75 Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Mon, 13 Feb 2012 18:06:31 -0800 Subject: [PATCH] bug 13651 Don't allow normal user to update project resources status 13651: resolved fixed reviewed-by: jessica --- ui/scripts/projects.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/ui/scripts/projects.js b/ui/scripts/projects.js index 8960b9a3d1b..0185b3a6b69 100644 --- a/ui/scripts/projects.js +++ b/ui/scripts/projects.js @@ -733,15 +733,22 @@ var project = args.context.projects[0]; var projectOwner = project.account; var currentAccount = args.context.users[0].account; + var hiddenTabs = []; - if ((!isAdmin() && !isDomainAdmin()) && - (currentAccount != projectOwner)) return ['accounts', 'invitations', 'resources']; + if (!isAdmin() && !isDomainAdmin()) { + hiddenTabs.push('resources'); - if (!cloudStack.projects.requireInvitation()) { - return ['invitations']; + if (currentAccount != projectOwner) { + hiddenTabs.push('accounts'); + hiddenTabs.push('invitations'); + } } - return []; + if (!cloudStack.projects.requireInvitation()) { + hiddenTabs.push('invitations'); + } + + return hiddenTabs; }, tabs: { details: {