Skip to content

Commit 40cadd0

Browse files
committed
merge fixes
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
1 parent 2f67356 commit 40cadd0

File tree

7 files changed

+17
-5
lines changed

7 files changed

+17
-5
lines changed

api/src/main/java/org/apache/cloudstack/api/command/admin/backup/CreateImageTransferCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public ImageTransfer.Direction getDirection() {
8181
}
8282

8383
public ImageTransfer.Format getFormat() {
84-
return EnumUtils.fromString(ImageTransfer.Format.class, format);
84+
return EnumUtils.getEnum(ImageTransfer.Format.class, format);
8585
}
8686

8787
@Override

plugins/integrations/veeam-control-service/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<parent>
2525
<groupId>org.apache.cloudstack</groupId>
2626
<artifactId>cloudstack-plugins</artifactId>
27-
<version>4.22.1.0-SNAPSHOT</version>
27+
<version>4.23.0.0-SNAPSHOT</version>
2828
<relativePath>../../pom.xml</relativePath>
2929
</parent>
3030
<dependencies>

plugins/integrations/veeam-control-service/src/main/java/org/apache/cloudstack/veeam/adapter/ServerAdapter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,11 +1447,11 @@ public ImageTransfer createImageTransfer(ImageTransfer request) {
14471447
}
14481448
accountService.checkAccess(CallContext.current().getCallingAccount(), null, false,
14491449
volumeVO);
1450-
Direction direction = EnumUtils.fromString(Direction.class, request.getDirection());
1450+
Direction direction = EnumUtils.getEnum(Direction.class, request.getDirection());
14511451
if (direction == null) {
14521452
throw new InvalidParameterValueException("Invalid or missing direction");
14531453
}
1454-
Format format = EnumUtils.fromString(Format.class, request.getFormat());
1454+
Format format = EnumUtils.getEnum(Format.class, request.getFormat());
14551455
Long backupId = null;
14561456
if (request.getBackup() != null && StringUtils.isNotBlank(request.getBackup().getId())) {
14571457
BackupVO backupVO = backupDao.findByUuid(request.getBackup().getId());

plugins/integrations/veeam-control-service/src/main/java/org/apache/cloudstack/veeam/api/dto/Vm.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ public String getType() {
348348

349349
@JsonIgnore
350350
public int getTypeOrdinal() {
351-
Type enumType = EnumUtils.fromString(Type.class, type, Type.q35_sea_bios);
351+
Type enumType = EnumUtils.getEnum(Type.class, type, Type.q35_sea_bios);
352352
return enumType.ordinal();
353353
}
354354

plugins/network-elements/juniper-contrail/src/test/java/org/apache/cloudstack/network/contrail/management/MockAccountManager.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,10 @@ public void validateUserPasswordAndUpdateIfNeeded(String newPassword, UserVO use
597597
public void checkApiAccess(Account account, String command, String apiKey) throws PermissionDeniedException {
598598
}
599599

600+
@Override
601+
public void checkApiAccess(Account caller, String command) throws PermissionDeniedException {
602+
}
603+
600604
@Override
601605
public UserAccount clearUserTwoFactorAuthenticationInSetupStateOnLogin(UserAccount user) {
602606
return null;

server/src/main/java/com/cloud/user/AccountManager.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,8 @@ void buildACLViewSearchCriteria(SearchCriteria<? extends ControlledViewEntity> s
204204

205205
void checkApiAccess(Account caller, String command, String apiKey);
206206

207+
void checkApiAccess(Account caller, String command);
208+
207209
UserAccount clearUserTwoFactorAuthenticationInSetupStateOnLogin(UserAccount user);
208210

209211
void verifyCallerPrivilegeForUserOrAccountOperations(Account userAccount);

server/src/main/java/com/cloud/user/AccountManagerImpl.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1535,6 +1535,12 @@ public void checkApiAccess(Account caller, String command, String apiKey) {
15351535
checkApiAccess(apiCheckers, caller, command, keyPairPermissions.toArray(new ApiKeyPairPermission[0]));
15361536
}
15371537

1538+
@Override
1539+
public void checkApiAccess(Account caller, String command) {
1540+
List<APIChecker> apiCheckers = getEnabledApiCheckers();
1541+
checkApiAccess(apiCheckers, caller, command);
1542+
}
1543+
15381544
@NotNull
15391545
private List<APIChecker> getEnabledApiCheckers() {
15401546
// we are really only interested in the dynamic access checker

0 commit comments

Comments
 (0)