有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java如何隐藏特定角色的自定义工作流?

我正在使用角色和权限。我必须创建一个权限来隐藏为特定角色创建的自定义工作流。当我在xml中添加这个bean文件和向导时,我根本无法启动工作流。如果还有别的办法,请告诉我。


这是我创建的bean文件

公共列表getResources() { 这资源=新阵列列表(4)

  UserTransaction tx = null;
  try
  {
     FacesContext context = FacesContext.getCurrentInstance();
     tx = Repository.getUserTransaction(context, true);
     tx.begin();

     for (String newItem : this.packageItemsToAdd)
     {
        NodeRef nodeRef = new NodeRef(newItem);
        if (this.getNodeService().exists(nodeRef))
        {
           // create our Node representation
           MapNode node = new MapNode(nodeRef, this.getNodeService(), true);
           this.browseBean.setupCommonBindingProperties(node);

           // add property resolvers to show path information
           node.addPropertyResolver("path", this.browseBean.resolverPath);
           node.addPropertyResolver("displayPath", this.browseBean.resolverDisplayPath);

           this.resources.add(node);
        }
        else
        {
           if (logger.isDebugEnabled())
              logger.debug("Ignoring " + nodeRef + " as it has been removed from the repository");
        }
     }

     // commit the transaction
     tx.commit();
  }
  catch (Throwable err)
  {
     Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
           FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), err.getMessage()), err);
     this.resources = Collections.<Node>emptyList();
     try { if (tx != null) {tx.rollback();} } catch (Exception tex) {}
  }

  return this.resources;

}

这是豆子种植 受保护的void resetRichList() { if(this.packageItemsRichList!=null) { 这packageItemsRichList。设置值(空); 这packageItemsRichList=null; } }

这是xml文件 合作者


共 (1) 个答案

  1. # 1 楼答案

    我可以回答,但你的问题太模糊了

    如果我只看这个问题,那么它非常简单>;只需创建一个检查自定义工作流操作的评估器

    查找文件web客户端配置工作流操作

    更改或覆盖此代码:

        <action id="start_workflow">
                <label-id>start_workflow</label-id>
                <image>/images/icons/new_workflow.gif</image>
                <evaluator>org.alfresco.web.action.evaluator.StartWorkflowEvaluator</evaluator>
                <action>wizard:startWorkflow</action>
                <action-listener>#{WizardManager.setupParameters}</action-listener>
                <params>
                   <param name="item-to-workflow">#{actionContext.id}</param>
                </params>
        </action>
    

    更改此行:

    <evaluator>org.alfresco.web.action.evaluator.StartWorkflowEvaluator</evaluator>
    

    添加到自定义Java类并检查正确的权限,或者只添加

    <permissions>
        <permission allow="true">Your Role aka Write, Collaborator, etc</permission>
    </permissions>