use of org.codelibs.fess.exception.UserRoleLoginException in project fess by codelibs.
the class FessLoginAssist method checkPermission.
@Override
protected void checkPermission(final LoginHandlingResource resource) throws LoginRequiredException {
if (FessAdminAction.class.isAssignableFrom(resource.getActionClass())) {
getSavedUserBean().ifPresent(user -> {
if (user.hasRoles(fessConfig.getAuthenticationAdminRolesAsArray())) {
return;
}
final Method executeMethod = resource.getExecuteMethod();
final Secured secured = executeMethod.getAnnotation(Secured.class);
if (secured != null && user.hasRoles(secured.value())) {
return;
}
throw new UserRoleLoginException(RootAction.class);
});
}
}
Aggregations