@Override public Set<String> resolveActions(Class<?> restInterface, Right grantedRight) { Method[] methods = restInterface.getMethods(); Set<String> result = new HashSet<>(); for (Method method : methods) { for (Annotation annotation : method.getAnnotations()) { HttpMethod httpMethod = annotation.annotationType().getAnnotation(HttpMethod.class); if (httpMethod != null) { RequiredAccess rightAnnotation = method.getAnnotation(RequiredAccess.class); if (grantedRight != null && rightAnnotation != null) { Right right = Right.toRight(rightAnnotation.value()); if (right == grantedRight || grantedRight.getImpliedRights() != null && grantedRight.getImpliedRights().contains(right)) { result.add(httpMethod.value()); } } else { result.add(httpMethod.value()); } } } } return result; } }
@Override public Set<String> resolveActions(Class<?> restInterface, Right grantedRight) { Method[] methods = restInterface.getMethods(); Set<String> result = new HashSet<>(); for (Method method : methods) { for (Annotation annotation : method.getAnnotations()) { HttpMethod httpMethod = annotation.annotationType().getAnnotation(HttpMethod.class); if (httpMethod != null) { RequiredAccess rightAnnotation = method.getAnnotation(RequiredAccess.class); if (grantedRight != null && rightAnnotation != null) { Right right = Right.toRight(rightAnnotation.value()); if (right == grantedRight || grantedRight.getImpliedRights() != null && grantedRight.getImpliedRights().contains(right)) { result.add(httpMethod.value()); } } else { result.add(httpMethod.value()); } } } } return result; } }