Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions server/src/com/cloud/network/NetworkServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -1101,8 +1101,8 @@ public Network createGuestNetwork(CreateNetworkCmd cmd) throws InsufficientCapac
}

// 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
Expand Down Expand Up @@ -1822,8 +1822,8 @@ public boolean deleteNetwork(long networkId, boolean forced) {

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
if ((network.getGuestType() == GuestType.Shared) && !_accountMgr.isAdmin(caller.getId())) {
throw new InvalidParameterValueException("Only Admins can delete network with guest type " + network.getGuestType());
}

Expand Down
2 changes: 1 addition & 1 deletion ui/scripts/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@
isHeader: true
}),

rootAdminAddL2Network: $.extend({}, addL2GuestNetwork.def, {
AddL2Network: $.extend({}, addL2GuestNetwork.def, {
isHeader: true
})

Expand Down
9 changes: 1 addition & 8 deletions ui/scripts/sharedFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -831,13 +831,6 @@ var addL2GuestNetwork = {
}
},

preFilter: function(args) {
if (isAdmin())
return true;
else
return false;
},

createForm: {
title: 'label.add.l2.guest.network',
fields: {
Expand Down Expand Up @@ -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({
Expand Down