Permissions for workflow / change default new workflow model
Hello,
I am using CQ 5.6.1. I want my content authors to be able to create workflow.
I have added the group 'workflow-editors' to the groups of the 'Authors' group, so now I can see permissions have been added on '/etc/workflows'.
But unfortunately this still does not allow members of the 'Authors' group to create a workflow.
When adding a new workflow model, a popup appears: 'Could not generate workflow model'.
In the logs I see the following Exception:
Context com.adobe.granite.workflow.console.servlet.ModelGenerateServlet: Could not create workflow model java.lang.IllegalStateException: Can't overwrite cause
at java.lang.Throwable.initCause(Throwable.java:456)
at org.apache.sling.api.SlingException.<init>(SlingException.java:73)
at com.adobe.granite.workflow.console.servlet.ServletUtil.getAuthorizable(ServletUtil.java:83)
at com.adobe.granite.workflow.console.servlet.ModelGenerateServlet$ContentVisitor.copyMetaData(ModelGenerateServlet.java:405)
at com.adobe.granite.workflow.console.servlet.ModelGenerateServlet$ContentVisitor.handleStep(ModelGenerateServlet.java:328)
at com.adobe.granite.workflow.console.servlet.ModelGenerateServlet$ContentVisitor.entering(ModelGenerateServlet.java:287)
at javax.jcr.util.TraversingItemVisitor.visit(TraversingItemVisitor.java:182)
at org.apache.jackrabbit.core.NodeImpl.accept(NodeImpl.java:1735)
at javax.jcr.util.TraversingItemVisitor.visit(TraversingItemVisitor.java:191)
at com.adobe.granite.workflow.console.servlet.ModelGenerateServlet.doPost(ModelGenerateServlet.java:161)
at org.apache.sling.api.servlets.SlingAllMethodsServlet.mayService(SlingAllMethodsServlet.java:148)
at org.apache.sling.api.servlets.SlingSafeMethodsServlet.service(SlingSafeMethodsServlet.java:344)
at org.apache.sling.api.servlets.SlingSafeMethodsServlet.service(SlingSafeMethodsServlet.java:375)
at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:508)
But the model does seem to be created though. As an author I cannot edit it. An error occurs on the page. The last part of the stacktrace is
Caused by: com.day.cq.security.NoSuchAuthorizableException: No Authorizable with ID admin
at com.day.cq.security.impl.CQUserManagerImpl.get(CQUserManagerImpl.java:140)
at org.apache.jsp.libs.cq.workflow.components.model.participant.details_jsp._jspService(details_jsp.java:176)
at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:502)
... 218 more
But as an admin I can edit that workflow and that's how I discovered what the problem is (while I was describing this issue here on the forum):
The newly created workflow contains a participant step, assigned to 'admin' (hence the error when opening the workflow as an Author I assume). If I remove the participant step (or assign it to a group the 'author' user belongs to like 'Contributors' or 'workflow-editors') the 'author' can edit the workflow model.
So my question now is: how can I change the default workflow model created, so that an author user can create a workflow model all by himself without interaction from an Admin?
Thanks in advance for any suggestions.
Luc Feys