Commit 9ab92ba73cddfb584bebfd3166e41908ae989236

Authored by YevhenBondarenko
1 parent 42dd3861

validateApiUsageState improvements

... ... @@ -250,6 +250,9 @@ public class AccessValidator {
250 250 if (currentUser.isSystemAdmin()) {
251 251 callback.onSuccess(ValidationResult.accessDenied(SYSTEM_ADMINISTRATOR_IS_NOT_ALLOWED_TO_PERFORM_THIS_OPERATION));
252 252 } else {
  253 + if (!operation.equals(Operation.READ_TELEMETRY)) {
  254 + callback.onSuccess(ValidationResult.accessDenied("Allowed only READ_TELEMETRY operation!"));
  255 + }
253 256 ApiUsageState apiUsageState = apiUsageStateService.findApiUsageStateById(currentUser.getTenantId(), new ApiUsageStateId(entityId.getId()));
254 257 if (apiUsageState == null) {
255 258 callback.onSuccess(ValidationResult.entityNotFound("Api Usage State with requested id wasn't found!"));
... ...