Merge remote-tracking branch 'origin/4.11' into 4.12

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Rohit Yadav 2019-03-25 13:24:46 +05:30
commit bbf5807688
3 changed files with 6 additions and 13 deletions

View File

@ -1117,8 +1117,8 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
}
// Only Admin can create Shared networks
if ((ntwkOff.getGuestType() == GuestType.Shared || ntwkOff.getGuestType() == GuestType.L2) && !_accountMgr.isAdmin(caller.getId())) {
throw new InvalidParameterValueException("Only Admins can create network with guest type " + GuestType.Shared + " or " + GuestType.L2);
if ((ntwkOff.getGuestType() == GuestType.Shared) && !_accountMgr.isAdmin(caller.getId())) {
throw new InvalidParameterValueException("Only Admins can create network with guest type " + GuestType.Shared);
}
// Check if the network is domain specific
@ -1829,8 +1829,8 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
Account owner = _accountMgr.getAccount(network.getAccountId());
// Only Admin can delete Shared and L2 networks
if ((network.getGuestType() == GuestType.Shared || network.getGuestType() == GuestType.L2) && !_accountMgr.isAdmin(caller.getId())) {
// Only Admin can delete Shared networks
if ((network.getGuestType() == GuestType.Shared) && !_accountMgr.isAdmin(caller.getId())) {
throw new InvalidParameterValueException("Only Admins can delete network with guest type " + network.getGuestType());
}

View File

@ -795,7 +795,7 @@
isHeader: true
}),
rootAdminAddL2Network: $.extend({}, addL2GuestNetwork.def, {
AddL2Network: $.extend({}, addL2GuestNetwork.def, {
isHeader: true
})

View File

@ -831,13 +831,6 @@ var addL2GuestNetwork = {
}
},
preFilter: function(args) {
if (isAdmin())
return true;
else
return false;
},
createForm: {
title: 'label.add.l2.guest.network',
fields: {
@ -867,7 +860,7 @@ var addL2GuestNetwork = {
url: createURL('listZones'),
success: function(json) {
var zones = $.grep(json.listzonesresponse.zone, function(zone) {
return (zone.networktype == 'Advanced' && zone.securitygroupsenabled != true); //Isolated networks can only be created in Advanced SG-disabled zone (but not in Basic zone nor Advanced SG-enabled zone)
return (zone.networktype == 'Advanced'); //Isolated networks can only be created in Advanced SG-disabled zone (but not in Basic zone nor Advanced SG-enabled zone)
});
args.response.success({