Browse Source
Merge pull request #13348 from irynamatveieva/fix/calculated-fields
Removed permission check when argument source is tenant
pull/13363/head
Viacheslav Klimov
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
4 additions and
1 deletions
-
application/src/main/java/org/thingsboard/server/controller/CalculatedFieldController.java
|
|
|
@ -270,7 +270,10 @@ public class CalculatedFieldController extends BaseController { |
|
|
|
for (EntityId referencedEntityId : referencedEntityIds) { |
|
|
|
EntityType entityType = referencedEntityId.getEntityType(); |
|
|
|
switch (entityType) { |
|
|
|
case TENANT, CUSTOMER, ASSET, DEVICE -> checkEntityId(referencedEntityId, Operation.READ); |
|
|
|
case TENANT -> { |
|
|
|
return; |
|
|
|
} |
|
|
|
case CUSTOMER, ASSET, DEVICE -> checkEntityId(referencedEntityId, Operation.READ); |
|
|
|
default -> |
|
|
|
throw new IllegalArgumentException("Calculated fields do not support '" + entityType + "' for referenced entities."); |
|
|
|
} |
|
|
|
|