in deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/extension/Authorizer.java [226:291]
boolean matchesBindings(Annotation annotation, Set<AuthorizationParameter> parameterBindings, Class<?> returnType)
{
if (!annotation.annotationType().isAnnotationPresent(SecurityBindingType.class) &&
annotation.annotationType().isAnnotationPresent(Stereotype.class))
{
annotation = SecurityUtils.resolveSecurityBindingType(annotation);
}
if (!annotation.annotationType().equals(bindingAnnotation.annotationType()))
{
return false;
}
for (Method method : annotation.annotationType().getDeclaredMethods())
{
if (method.isAnnotationPresent(Nonbinding.class))
{
continue;
}
if (!bindingSecurityBindingMembers.containsKey(method))
{
return false;
}
try
{
Object value = method.invoke(annotation);
if (!bindingSecurityBindingMembers.get(method).equals(value))
{
return false;
}
}
catch (InvocationTargetException ex)
{
throw new SecurityDefinitionException("Error reading security binding members", ex);
}
catch (IllegalAccessException ex)
{
throw new SecurityDefinitionException("Error reading security binding members", ex);
}
}
for (AuthorizationParameter authorizationParameter : authorizationParameters)
{
boolean found = false;
for (AuthorizationParameter parameterBinding : parameterBindings)
{
if (parameterBinding.matches(authorizationParameter))
{
found = true;
}
}
if (!found)
{
return false;
}
}
if (!matches(returnType))
{
return false;
}
return true;
}