【问题标题】:How to hide custom workflows for a particular role?如何隐藏特定角色的自定义工作流程?
【发布时间】:2011-06-06 09:39:26
【问题描述】:

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


这是我创建的 bean 文件

公共列表 getResources() { this.resources = new ArrayList(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;

}

这里是 bean implimentatin 受保护的无效 resetRichList() { if (this.packageItemsRichList != null) { this.packageItemsRichList.setValue(null); this.packageItemsRichList = null; } }

这是xml文件 合作者

【问题讨论】:

    标签: java xml alfresco


    【解决方案1】:

    这个我可以回答,但是你的问题太模糊了。

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

    找到文件 web-client-config-workflow-actions。

    更改或覆盖此代码:

        <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>
    

    【讨论】:

    • 有关信息,web-client-config-workflow-actions.xml 位于 tomcat\webapps\alfresco\WEB-INF\classes\alfresco 中(在 Alfresco Community 4.0.d 的默认安装中)
    猜你喜欢
    • 1970-01-01
    • 2018-10-04
    • 2014-05-26
    • 1970-01-01
    • 2013-05-18
    • 2019-10-28
    • 2021-03-01
    • 2020-04-05
    • 2013-02-04
    相关资源
    最近更新 更多