cloudstack 3.0 UI - Make Account page/User page available to normal-user role.

This commit is contained in:
Jessica Wang 2012-03-05 11:33:46 -08:00
parent 1cd4ef5f07
commit 1dbd10e5e9
2 changed files with 45 additions and 26 deletions

View File

@ -619,6 +619,7 @@
} }
var accountObj = args.context.accounts[0]; var accountObj = args.context.accounts[0];
if(isAdmin() || isDomainAdmin()) {
$.ajax({ $.ajax({
url: createURL("listUsers&domainid=" + accountObj.domainid + "&account=" + accountObj.name + "&page=" + args.page + "&pagesize=" + pageSize + array1.join("")), url: createURL("listUsers&domainid=" + accountObj.domainid + "&account=" + accountObj.name + "&page=" + args.page + "&pagesize=" + pageSize + array1.join("")),
dataType: "json", dataType: "json",
@ -629,6 +630,13 @@
}); });
} }
}) })
}
else { //normal user doesn't have access listUsers API until Bug 14127 is fixed.
args.response.success({
actionFilter: userActionfilter,
data: accountObj.user
});
}
}, },
actions: { actions: {
add: { add: {
@ -970,6 +978,7 @@
], ],
dataProvider: function(args) { dataProvider: function(args) {
if(isAdmin() || isDomainAdmin()) {
$.ajax({ $.ajax({
url: createURL('listUsers'), url: createURL('listUsers'),
data: { data: {
@ -983,6 +992,13 @@
} }
}); });
} }
else { //normal user doesn't have access listUsers API until Bug 14127 is fixed.
args.response.success({
actionFilter: userActionfilter,
data: args.context.users[0]
});
}
}
} }
} }
} }
@ -1013,8 +1029,11 @@
} }
allowedActions.push("remove"); allowedActions.push("remove");
} }
}
allowedActions.push("updateResourceCount"); allowedActions.push("updateResourceCount");
}
else if(isDomainAdmin()) {
allowedActions.push("updateResourceCount");
}
return allowedActions; return allowedActions;
} }

View File

@ -10,10 +10,10 @@
return ["dashboard", "instances", "storage", "network", "templates", "accounts", "domains", "events", "projects"]; return ["dashboard", "instances", "storage", "network", "templates", "accounts", "domains", "events", "projects"];
} }
else if (g_userProjectsEnabled) { else if (g_userProjectsEnabled) {
return ["dashboard", "instances", "storage", "network", "templates", "events", "projects"]; return ["dashboard", "instances", "storage", "network", "templates", "accounts", "events", "projects"];
} }
else { //normal user else { //normal user
return ["dashboard", "instances", "storage", "network", "templates", "events"]; return ["dashboard", "instances", "storage", "network", "templates", "accounts", "events"];
} }
}, },
sections: { sections: {