Skip to content

Commit cf596c2

Browse files
Check the network access when deploying VM in Advanced Security Group.
1 parent 85c5997 commit cf596c2

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

server/src/main/java/com/cloud/vm/UserVmManagerImpl.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3517,6 +3517,8 @@ public UserVm createAdvancedSecurityGroupVirtualMachine(DataCenter zone, Service
35173517
throw new InvalidParameterValueException("Network is not security group enabled: " + network.getId());
35183518
}
35193519

3520+
_accountMgr.checkAccess(owner, AccessType.UseEntry, false, network);
3521+
35203522
networkList.add(network);
35213523
}
35223524
isSecurityGroupEnabledNetworkUsed = true;
@@ -3540,9 +3542,8 @@ public UserVm createAdvancedSecurityGroupVirtualMachine(DataCenter zone, Service
35403542
}
35413543

35423544
// Perform account permission check
3543-
if (network.getAclType() == ACLType.Account) {
3544-
_accountMgr.checkAccess(caller, AccessType.UseEntry, false, network);
3545-
}
3545+
_accountMgr.checkAccess(owner, AccessType.UseEntry, false, network);
3546+
35463547
networkList.add(network);
35473548
}
35483549
}

0 commit comments

Comments
 (0)