You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: plugins/network-elements/juniper-contrail/src/test/java/org/apache/cloudstack/network/contrail/management/MockAccountManager.java
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -514,4 +514,9 @@ public String getConfigComponentName() {
logger.debug(String.format("Checking if [%s] has permission for expunging VMs.", callingAccount));
3342
+
if (!_accountMgr.isAdmin(callingAccount.getId()) && !getConfigAllowUserExpungeRecoverVm(callingAccount.getId())) {
3343
+
logger.error(String.format("Parameter [%s] can only be passed by Admin accounts or when the allow.user.expunge.recover.vm key is true.", ApiConstants.EXPUNGE));
3344
+
thrownewPermissionDeniedException("Account does not have permission for expunging.");
@@ -3345,10 +3368,10 @@ public UserVm destroyVm(DestroyVMCmd cmd) throws ResourceUnavailableException, C
3345
3368
longvmId = cmd.getId();
3346
3369
booleanexpunge = cmd.getExpunge();
3347
3370
3348
-
// When trying to expunge, permission is denied when the caller is not an admin and the AllowUserExpungeRecoverVm is false for the caller.
3349
-
if (expunge && !_accountMgr.isAdmin(ctx.getCallingAccount().getId()) && !AllowUserExpungeRecoverVm.valueIn(cmd.getEntityOwnerId())) {
3350
-
thrownewPermissionDeniedException("Parameter " + ApiConstants.EXPUNGE + " can be passed by Admin only. Or when the allow.user.expunge.recover.vm key is set.");
self.cleanup[-1]=domadm# Hacky way to reverse cleanup order to avoid deleting the role before account. Remove this line when tearDown is changed to call super().
990
+
self.cleanup.append(role) # Should be self.cleanup.append(domadm) when tearDown is changed to call super().
0 commit comments