/** * Checks if the current user has a permission on a path. * * @param session * @param path * @param permission * @return */ private static boolean hasPermission(Session session, String path, String permission) { try { session.checkPermission(path, permission); return true; } catch (AccessControlException e) { return false; } catch (RepositoryException e) { return false; } }