Commit 9ab92ba73cddfb584bebfd3166e41908ae989236
1 parent
42dd3861
validateApiUsageState improvements
Showing
1 changed file
with
3 additions
and
0 deletions
@@ -250,6 +250,9 @@ public class AccessValidator { | @@ -250,6 +250,9 @@ public class AccessValidator { | ||
250 | if (currentUser.isSystemAdmin()) { | 250 | if (currentUser.isSystemAdmin()) { |
251 | callback.onSuccess(ValidationResult.accessDenied(SYSTEM_ADMINISTRATOR_IS_NOT_ALLOWED_TO_PERFORM_THIS_OPERATION)); | 251 | callback.onSuccess(ValidationResult.accessDenied(SYSTEM_ADMINISTRATOR_IS_NOT_ALLOWED_TO_PERFORM_THIS_OPERATION)); |
252 | } else { | 252 | } else { |
253 | + if (!operation.equals(Operation.READ_TELEMETRY)) { | ||
254 | + callback.onSuccess(ValidationResult.accessDenied("Allowed only READ_TELEMETRY operation!")); | ||
255 | + } | ||
253 | ApiUsageState apiUsageState = apiUsageStateService.findApiUsageStateById(currentUser.getTenantId(), new ApiUsageStateId(entityId.getId())); | 256 | ApiUsageState apiUsageState = apiUsageStateService.findApiUsageStateById(currentUser.getTenantId(), new ApiUsageStateId(entityId.getId())); |
254 | if (apiUsageState == null) { | 257 | if (apiUsageState == null) { |
255 | callback.onSuccess(ValidationResult.entityNotFound("Api Usage State with requested id wasn't found!")); | 258 | callback.onSuccess(ValidationResult.entityNotFound("Api Usage State with requested id wasn't found!")); |