bug 12984

Allow domain admins the same project privileges as ROOT admins

status 12984: resolved fixed
This commit is contained in:
bfederle 2012-01-30 16:17:48 -08:00
parent c42f50c4b0
commit 1562c2fe7a
2 changed files with 9 additions and 8 deletions

View File

@ -486,7 +486,7 @@
url: createURL('listProjects', { ignoreProject: true }),
data: {
accountId: user.userid,
listAll: isAdmin()
listAll: true
},
dataType: 'json',
async: true,
@ -539,7 +539,7 @@
}
}
var apiCmd = "listProjects&page=" + args.page + "&pagesize=" + pageSize + array1.join("") + '&listAll=' + isAdmin();
var apiCmd = "listProjects&page=" + args.page + "&pagesize=" + pageSize + array1.join("") + '&listAll=true';
$.ajax({
url: createURL(apiCmd, { ignoreProject: true }),
dataType: 'json',
@ -829,7 +829,8 @@
var projectsActionFilter = function(args) {
var allowedActions = ['destroy'];
if (args.context.item.account == cloudStack.context.users[0].account || isAdmin()) {
if (args.context.item.account == cloudStack.context.users[0].account ||
isAdmin() || isDomainAdmin()) {
if (args.context.item.state == 'Suspended') {
allowedActions.push('enable');
} else if (args.context.item.state == 'Active') {

View File

@ -160,7 +160,7 @@
};
// Only show management tabs to owner of project
if (isAdmin() || (
if (isAdmin() || isDomainAdmin() || (
cloudStack.context.projects &&
(cloudStack.context.projects[0].account == cloudStack.context.users[0].account)
)) {
@ -170,7 +170,7 @@
tabs.invitations = pageElems.dashboardTabs.invitations;
}
if (isAdmin()) {
if (isAdmin() || isDomainAdmin()) {
tabs.resources = pageElems.dashboardTabs.resources;
}
}
@ -333,7 +333,7 @@
)
);
if (isAdmin()) {
if (isAdmin() || isDomainAdmin()) {
$ul.append(
// Resources tab
$('<li>').addClass('last').append(
@ -346,7 +346,7 @@
cloudStack.context.projects = [project];
var $resources;
if (isAdmin()) {
if (isAdmin() || isDomainAdmin()) {
$resouces = $('<div>')
.attr({ id: 'new-project-review-tabs-resouces' })
.appendTo($tabs)
@ -544,7 +544,7 @@
loadData(function() {
if (!$list.find('li').size()) {
cloudStack.dialog.notice({
message: isAdmin() || g_userProjectsEnabled ?
message: isAdmin() || isDomainAdmin() || g_userProjectsEnabled ?
'You do not have any projects.<br/>Please create a new one from the projects section.' :
'You do not have any projects.<br/>Please ask your administrator to create a new project.'
}).closest('.ui-dialog');