/**
   * @see org.alfresco.web.action.ActionEvaluator#evaluate(org.alfresco.web.bean.repository.Node)
   */
  public boolean evaluate(final Node node) {
    // is the authenticated user permitted to execute the regenerate renditions action
    // against at least one web project
    boolean isUserAllowed = false;

    final FacesContext fc = FacesContext.getCurrentInstance();
    final ServiceRegistry services = Repository.getServiceRegistry(fc);
    final PermissionService permissionService = services.getPermissionService();
    final WebProjectService webProjectService = services.getWebProjectService();
    final NavigationBean navigator =
        (NavigationBean) FacesHelper.getManagedBean(fc, NavigationBean.BEAN_NAME);

    // check that the authenticated user has CONTENT MANAGER permissions for at least one web
    // project
    // this will ensure that the action appears only if the user is able to regenerate renditions
    // for at least one web project
    List<WebProjectInfo> wpInfos = webProjectService.listWebProjects();
    for (WebProjectInfo wpInfo : wpInfos) {
      if (permissionService.hasPermission(
              wpInfo.getNodeRef(), PermissionService.WCM_CONTENT_MANAGER)
          == AccessStatus.ALLOWED) {
        isUserAllowed = true;
        break;
      }
    }

    // TODO improve how we determine whether the form supports the ability to regenerate renditions
    // or not

    // get the path to the current name - compare each path element with the Web Forms folder name
    final Path path = navigator.getCurrentNode().getNodePath();

    boolean isWebFormsPath = false;
    Iterator<Path.Element> itr = path.iterator();
    while (itr.hasNext()) {
      Path.Element element = (Path.Element) itr.next();
      String pathElement = element.getPrefixedString(services.getNamespaceService());
      if (Application.getWebContentFormsFolderName(fc).equals(pathElement)) {
        isWebFormsPath = true;
        break;
      }
    }

    return (node.hasAspect(WCMAppModel.ASPECT_RENDERING_ENGINE_TEMPLATE) || isWebFormsPath)
        && isUserAllowed;
  }