You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "bernardodemarco (via GitHub)" <gi...@apache.org> on 2024/09/01 14:28:51 UTC

Re: [PR] Global setting to allow/disallow users to force stop a vm [cloudstack]

bernardodemarco commented on code in PR #9569:
URL: https://github.com/apache/cloudstack/pull/9569#discussion_r1740119014


##########
server/src/main/java/com/cloud/vm/UserVmManagerImpl.java:
##########
@@ -5341,6 +5341,13 @@ protected void updateVncPasswordIfItHasChanged(String originalVncPassword, Strin
     public void finalizeExpunge(VirtualMachine vm) {
     }
 
+    private void checkForceStopVmPermission(Account callingAccount) {
+        if (!AllowUserForceStopVm.valueIn(callingAccount.getId())) {
+            logger.error(String.format("Parameter [%s] can only be passed by Admin accounts or when the allow.user.force.stop.vm config is true for the account.", ApiConstants.FORCED));

Review Comment:
   Just a minor suggestion regarding the `log4j2` syntax.
   
   ```suggestion
               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);
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org