This commit is contained in:
desoliture 2022-01-19 16:35:30 +02:00
parent 220665bf0f
commit 5a47bf3b8b

View File

@ -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);
}
}