mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
bug 12902
Disable project creation for regular users, if 'allowusercreateprojects' == false
This commit is contained in:
parent
263065a0ff
commit
9f08581f94
@ -9,9 +9,12 @@
|
||||
else if(isDomainAdmin()) {
|
||||
return ["dashboard", "instances", "storage", "network", "templates", "accounts", "domains", "events", "projects"];
|
||||
}
|
||||
else { //normal user
|
||||
else if (g_userProjectsEnabled) {
|
||||
return ["dashboard", "instances", "storage", "network", "templates", "events", "projects"];
|
||||
}
|
||||
else { //normal user
|
||||
return ["dashboard", "instances", "storage", "network", "templates", "events"];
|
||||
}
|
||||
},
|
||||
sections: {
|
||||
/**
|
||||
@ -99,6 +102,9 @@
|
||||
g_firewallRuleUiEnabled = json.listcapabilitiesresponse.capability.firewallRuleUiEnabled.toString(); //convert boolean to string if it's boolean
|
||||
$.cookie('firewallRuleUiEnabled', g_firewallRuleUiEnabled, { expires: 1});
|
||||
|
||||
g_userProjectsEnabled = json.listcapabilitiesresponse.capability.allowusercreateprojects;
|
||||
$.cookie('userProjectsEnabled', g_userProjectsEnabled, { expires: 1 });
|
||||
|
||||
if (json.listcapabilitiesresponse.capability.userpublictemplateenabled != null) {
|
||||
g_userPublicTemplateEnabled = json.listcapabilitiesresponse.capability.userpublictemplateenabled.toString(); //convert boolean to string if it's boolean
|
||||
$.cookie('userpublictemplateenabled', g_userPublicTemplateEnabled, { expires: 1});
|
||||
@ -212,6 +218,9 @@
|
||||
$.cookie('directattachsecuritygroupsenabled', g_directAttachSecurityGroupsEnabled, { expires: 1});
|
||||
}
|
||||
|
||||
g_userProjectsEnabled = json.listcapabilitiesresponse.capability.allowusercreateprojects;
|
||||
$.cookie('userProjectsEnabled', g_userProjectsEnabled, { expires: 1 });
|
||||
|
||||
args.response.success({
|
||||
data: {
|
||||
user: $.extend(true, {}, loginresponse, {
|
||||
|
||||
@ -544,8 +544,9 @@
|
||||
loadData(function() {
|
||||
if (!$list.find('li').size()) {
|
||||
cloudStack.dialog.notice({
|
||||
message: 'You do not have any projects. '
|
||||
+ 'Please create a new project from the projects section.'
|
||||
message: isAdmin() || 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');
|
||||
$.merge($selector, $('.overlay')).remove();
|
||||
$('.select.default-view').click();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user