mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-cloudstack
This commit is contained in:
commit
4da87bd9dd
@ -566,26 +566,30 @@
|
||||
},
|
||||
gateways: {
|
||||
add: {
|
||||
preCheck: function(args) {
|
||||
var items;
|
||||
|
||||
$.ajax({
|
||||
url: createURL('listPrivateGateways'),
|
||||
async: false,
|
||||
data: {
|
||||
vpcid: args.context.vpc[0].id,
|
||||
listAll: true
|
||||
},
|
||||
success: function(json) {
|
||||
items = json.listprivategatewaysresponse.privategateway;
|
||||
}
|
||||
});
|
||||
|
||||
if (items && items.length) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
preCheck: function(args) {
|
||||
if(isAdmin()) { //root-admin
|
||||
var items;
|
||||
$.ajax({
|
||||
url: createURL('listPrivateGateways'),
|
||||
async: false,
|
||||
data: {
|
||||
vpcid: args.context.vpc[0].id,
|
||||
listAll: true
|
||||
},
|
||||
success: function(json) {
|
||||
items = json.listprivategatewaysresponse.privategateway;
|
||||
}
|
||||
});
|
||||
if (items && items.length) {
|
||||
return true; //show private gateway listView
|
||||
}
|
||||
else {
|
||||
return false; //show create private gateway dialog
|
||||
}
|
||||
}
|
||||
else { //regular-user, domain-admin
|
||||
return true; //show private gateway listView instead of create private gateway dialog because only root-admin is allowed to create private gateway
|
||||
}
|
||||
},
|
||||
label: 'Add new gateway',
|
||||
messages: {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user