Search in sources :

Example 1 with AuthorizationEvaluator

use of eu.bcvsolutions.idm.core.security.api.service.AuthorizationEvaluator in project CzechIdMng by bcvsolutions.

the class DefaultAuthorizationManager method getSupportedEvaluators.

@Override
@SuppressWarnings({ "rawtypes" })
public List<AuthorizationEvaluatorDto> getSupportedEvaluators() {
    List<AuthorizationEvaluatorDto> evaluators = new ArrayList<>();
    for (Entry<String, AuthorizationEvaluator> entry : context.getBeansOfType(AuthorizationEvaluator.class).entrySet()) {
        AuthorizationEvaluator<?> evaluator = entry.getValue();
        AuthorizationEvaluatorDto evaluatorDto = new AuthorizationEvaluatorDto();
        evaluatorDto.setEntityType(evaluator.getEntityClass().getCanonicalName());
        evaluatorDto.setEvaluatorType(evaluator.getClass().getCanonicalName());
        evaluatorDto.setModule(evaluator.getModule());
        evaluatorDto.setParameters(evaluator.getParameterNames());
        evaluatorDto.setSupportsPermissions(evaluator.supportsPermissions());
        // resolve documentation
        evaluatorDto.setDescription(AutowireHelper.getBeanDescription(entry.getKey()));
        evaluators.add(evaluatorDto);
    }
    return evaluators;
}
Also used : AuthorizationEvaluator(eu.bcvsolutions.idm.core.security.api.service.AuthorizationEvaluator) ArrayList(java.util.ArrayList) AuthorizationEvaluatorDto(eu.bcvsolutions.idm.core.security.api.dto.AuthorizationEvaluatorDto)

Aggregations

AuthorizationEvaluatorDto (eu.bcvsolutions.idm.core.security.api.dto.AuthorizationEvaluatorDto)1 AuthorizationEvaluator (eu.bcvsolutions.idm.core.security.api.service.AuthorizationEvaluator)1 ArrayList (java.util.ArrayList)1