Browse Source

refactor

pull/5924/head
desoliture 5 years ago
parent
commit
5a47bf3b8b
  1. 4
      application/src/main/java/org/thingsboard/server/controller/EntityRelationController.java

4
application/src/main/java/org/thingsboard/server/controller/EntityRelationController.java

@ -379,10 +379,10 @@ public class EntityRelationController extends BaseController {
private void checkRelation(EntityId from, EntityId to) throws ThingsboardException {
UUID currentUserTenantId = getCurrentUser().getTenantId().getId();
if (from.getEntityType() != EntityType.TENANT || !from.getId().equals(currentUserTenantId)) {
if (!(from.getEntityType() == EntityType.TENANT && from.getId().equals(currentUserTenantId))) {
checkEntityId(from, Operation.WRITE);
}
if (to.getEntityType() != EntityType.TENANT || !to.getId().equals(currentUserTenantId)) {
if (!(to.getEntityType() == EntityType.TENANT && to.getId().equals(currentUserTenantId))) {
checkEntityId(to, Operation.WRITE);
}
}

Loading…
Cancel
Save