use of org.apache.deltaspike.security.api.authorization.Secures in project deltaspike by apache.
the class SecuredAnnotationAuthorizer method doSecuredCheck.
@Secures
@Secured({})
@SuppressWarnings("UnusedDeclaration")
public boolean doSecuredCheck(InvocationContext invocationContext) throws Exception {
List<Class<? extends AccessDecisionVoter>> voterClasses = new ArrayList<Class<? extends AccessDecisionVoter>>();
List<Annotation> annotatedTypeMetadata = extractMetadata(invocationContext);
for (Annotation annotation : annotatedTypeMetadata) {
if (Secured.class.isAssignableFrom(annotation.annotationType())) {
voterClasses.addAll(Arrays.asList(((Secured) annotation).value()));
} else if (voterContext instanceof EditableAccessDecisionVoterContext) {
((EditableAccessDecisionVoterContext) voterContext).addMetaData(annotation.annotationType().getName(), annotation);
}
}
invokeVoters(invocationContext, voterClasses);
// X TODO check the use-cases for it
return true;
}
Aggregations