mirror of https://github.com/apache/cloudstack.git
Apply suggestion from @abh1sar
Co-authored-by: Abhisar Sinha <63767682+abh1sar@users.noreply.github.com>
This commit is contained in:
parent
2b2d5fa26f
commit
773dea9bae
|
|
@ -5604,7 +5604,8 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
|
|||
}
|
||||
|
||||
private void checkForceStopVmPermission(Account callingAccount) {
|
||||
if (callingAccount == null || !AllowUserForceStopVm.valueIn(callingAccount.getId())) {
|
||||
callingAccountId = callingAccount == null ? null : callingAccount.getId();
|
||||
if (!AllowUserForceStopVm.valueIn(callingAccountId)) {
|
||||
logger.error("Parameter [{}] can only be passed by Admin accounts or when the allow.user.force.stop.vm config is true for the account.", ApiConstants.FORCED);
|
||||
throw new PermissionDeniedException("Account does not have the permission to force stop the vm.");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue