Restriction restriction = null;
Method method = getComponent().getBeanClass().getMethod(
interfaceMethod.getName(), interfaceMethod.getParameterTypes() );
Restrict restrict = null;
if ( method.isAnnotationPresent(Restrict.class) )
{
restrict = method.getAnnotation(Restrict.class);
}
else if ( getComponent().getBeanClass().isAnnotationPresent(Restrict.class) )
{
if ( !getComponent().isLifecycleMethod(method) )
{
restrict = getComponent().getBeanClass().getAnnotation(Restrict.class);
}
}
if (restrict != null)
{
if (restriction == null) restriction = new Restriction();
if ( Strings.isEmpty(restrict.value()) )
{
restriction.setPermissionTarget(getComponent().getName());
restriction.setPermissionAction(method.getName());
}
else
{
restriction.setExpression(restrict.value());
}
}
for (Annotation annotation : method.getDeclaringClass().getAnnotations())
{