use of com.evolveum.midpoint.web.application.AuthorizationAction in project midpoint by Evolveum.
the class SecurityUtils method isPageAuthorized.
public static boolean isPageAuthorized(Class page) {
if (page == null) {
return false;
}
PageDescriptor descriptor = (PageDescriptor) page.getAnnotation(PageDescriptor.class);
if (descriptor == null) {
return false;
}
AuthorizationAction[] actions = descriptor.action();
List<String> list = new ArrayList<>();
if (actions != null) {
for (AuthorizationAction action : actions) {
list.add(action.actionUri());
}
}
return WebComponentUtil.isAuthorized(list.toArray(new String[list.size()]));
}
Aggregations