protected boolean isAdmin(HttpServletRequest request) {
String username = request.getRemoteUser();
User currentUser = getUserService().findUserByName(username);
if (currentUser == null) return false;
UserRole role = currentUser.getRole();
if (role == null) return false;
return role.isAdmin();
}