publication from createLenyaDocTransformer : - this transformer is call from a module url says "default/modules/lenyaDocWriting/addMedia" - this transformer try to publish the document "/default/tutorial.html" - in modules-core/usecase/java/src/org/apache/lenya/cms/usecase/impl/UsecaseInvokerImpl.java - Roles are retrieve from the request : that is on modules/lenyaDocWriting - and not from the documentURL/webappUrl that is on "/default/tutorial.html" - a way could be to take in consideration the documentURL, but roles are get from a request create by : -- Request request = contextUtil.getRequest(); -- see protected boolean isUsecaseAuthorized(String webappUrl, String usecaseName) throws Exception { ... but the request seems not to be configurable... - In fact, during invoke workflow, roles and rights are checked for the current position in publication (request) and not on the position of the applied element (if the invoke is done on another document in the publication). - This can be a security risk ? - See how document creation implement this case as we have to be logged to create a document ==== - the more "clean method" : UsecaseInvoker invoker = null; try { invoker = (UsecaseInvoker) this.manager.lookup(UsecaseInvoker.ROLE); Map params = new HashMap(); // params.put(..., ...); // invoker.invoke(getSourceUrl(), "publish", params); reportResult("","PROBLEM","URL",lenyaDoc.getCanonicalDocumentURL(),lenyaDoc.getCanonicalWebappURL(),""); invoker.invoke(lenyaDoc.getCanonicalWebappURL(), "workflow.submit", params); //invoker.invoke("/default/authoring/concepts.html", "workflow.submit", params); // invoker.invoke(lenyaDoc.getCanonicalWebappURL(), // "workflow.publish", params); if (invoker.getResult() != UsecaseInvoker.SUCCESS) { // /A REMETTRE List messages = invoker.getErrorMessages(); for (Iterator i = messages.iterator(); i.hasNext();) { UsecaseMessage message = (UsecaseMessage) i.next(); // addErrorMessage(message.getMessage(), // message.getParameters()); reportResult("", "PROBLEM-LIST", "USECASE PROBLEM", message.getMessage(), Arrays.toString(message.getParameters()), ""); } } } catch (ServiceException se) { reportResult("", "PROBLEM123", "ServiceException", se.getMessage(), "", ""); } catch (UsecaseException ue) { reportResult("", "PROBLEM44", "UsecaseException", ue.getMessage(), "", ""); } finally { if (invoker != null) { this.manager.release(invoker); } }