fixed customer id check for Customer

This commit is contained in:
dashevchenko 2025-04-11 20:36:22 +03:00
parent 32611a19c6
commit 3e41cbef87
2 changed files with 4 additions and 4 deletions

View File

@ -1131,7 +1131,7 @@ public class EntityServiceTest extends AbstractControllerTest {
String customerName = result.getData().get(0).getLatest().get(EntityKeyType.ENTITY_FIELD).get("name").getValue();
assertThat(customerName).isEqualTo(TEST_CUSTOMER_NAME);
// find by customer user with generic permission
// find by customer user
PageData<EntityData> customerResults = findByQueryAndCheck(customerId, query, 1);
customerName = customerResults.getData().get(0).getLatest().get(EntityKeyType.ENTITY_FIELD).get("name").getValue();

View File

@ -64,9 +64,9 @@ public abstract class AbstractQueryProcessor<T extends EntityFilter> implements
}
protected static boolean checkCustomerId(UUID customerId, EntityData<?> ed) {
return customerId.equals(ed.getCustomerId()) || (ed.getEntityType() == EntityType.DASHBOARD &&
ed.getFields().getAssignedCustomerIds().contains(customerId)
|| (ed.getEntityType() == EntityType.CUSTOMER && customerId.equals(ed.getId())));
return customerId.equals(ed.getCustomerId())
|| (ed.getEntityType() == EntityType.DASHBOARD && ed.getFields().getAssignedCustomerIds().contains(customerId))
|| (ed.getEntityType() == EntityType.CUSTOMER && customerId.equals(ed.getId()));
}
protected boolean matches(EntityData<?> ed) {