use of eu.bcvsolutions.idm.core.api.dto.filter.IdmRoleFilter in project CzechIdMng by bcvsolutions.
the class RoleSynchronizationExecutor method findByAttribute.
@Override
protected IdmRoleDto findByAttribute(String idmAttributeName, String value) {
CorrelationFilter filter = getEntityFilter();
filter.setProperty(idmAttributeName);
filter.setValue(value);
List<IdmRoleDto> entities = roleService.find((IdmRoleFilter) filter, null).getContent();
if (CollectionUtils.isEmpty(entities)) {
return null;
}
if (entities.size() > 1) {
throw new ProvisioningException(AccResultCode.SYNCHRONIZATION_CORRELATION_TO_MANY_RESULTS, ImmutableMap.of("correlationAttribute", idmAttributeName, "value", value));
}
if (entities.size() == 1) {
return entities.get(0);
}
return null;
}
use of eu.bcvsolutions.idm.core.api.dto.filter.IdmRoleFilter in project CzechIdMng by bcvsolutions.
the class RoleForRequestEvaluatorIntegrationTest method getRoleAsUser.
private Page<IdmRoleDto> getRoleAsUser(IdmIdentityDto user, IdmRoleDto role) {
try {
loginService.login(new LoginDto(user.getUsername(), new GuardedString(TEST_PWD)));
//
IdmRoleFilter rf = getRoleFilter("name", role.getName());
Page<IdmRoleDto> readRole = roleService.find(rf, null, IdmBasePermission.READ);
return readRole;
} finally {
logout();
}
}
Aggregations