fixed customer id check for Customer
This commit is contained in:
parent
32611a19c6
commit
3e41cbef87
@ -1131,7 +1131,7 @@ public class EntityServiceTest extends AbstractControllerTest {
|
|||||||
String customerName = result.getData().get(0).getLatest().get(EntityKeyType.ENTITY_FIELD).get("name").getValue();
|
String customerName = result.getData().get(0).getLatest().get(EntityKeyType.ENTITY_FIELD).get("name").getValue();
|
||||||
assertThat(customerName).isEqualTo(TEST_CUSTOMER_NAME);
|
assertThat(customerName).isEqualTo(TEST_CUSTOMER_NAME);
|
||||||
|
|
||||||
// find by customer user with generic permission
|
// find by customer user
|
||||||
PageData<EntityData> customerResults = findByQueryAndCheck(customerId, query, 1);
|
PageData<EntityData> customerResults = findByQueryAndCheck(customerId, query, 1);
|
||||||
|
|
||||||
customerName = customerResults.getData().get(0).getLatest().get(EntityKeyType.ENTITY_FIELD).get("name").getValue();
|
customerName = customerResults.getData().get(0).getLatest().get(EntityKeyType.ENTITY_FIELD).get("name").getValue();
|
||||||
|
|||||||
@ -64,9 +64,9 @@ public abstract class AbstractQueryProcessor<T extends EntityFilter> implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected static boolean checkCustomerId(UUID customerId, EntityData<?> ed) {
|
protected static boolean checkCustomerId(UUID customerId, EntityData<?> ed) {
|
||||||
return customerId.equals(ed.getCustomerId()) || (ed.getEntityType() == EntityType.DASHBOARD &&
|
return customerId.equals(ed.getCustomerId())
|
||||||
ed.getFields().getAssignedCustomerIds().contains(customerId)
|
|| (ed.getEntityType() == EntityType.DASHBOARD && ed.getFields().getAssignedCustomerIds().contains(customerId))
|
||||||
|| (ed.getEntityType() == EntityType.CUSTOMER && customerId.equals(ed.getId())));
|
|| (ed.getEntityType() == EntityType.CUSTOMER && customerId.equals(ed.getId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean matches(EntityData<?> ed) {
|
protected boolean matches(EntityData<?> ed) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user