10-08-2008 11:45 AM
…
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
var reviewerSpace = reviewer.properties["cm:homeFolder"];
var docName = bpm_package.children[0].properties["name"];
<!– permissions for initiator –>
reviewerSpace.setPermission("CreateChildren",initiator.properties.userName);
var docExist = reviewerSpace.childByNamePath(docName);
if (docExist == null)
{
var cpy = bpm_package.children[0].copy(reviewerSpace);
}
<!– remove permission –>
espacoReviewer.removePermission("CreateChildren",initiator.properties.userName);
</script>
</action>
…
…
Failed to execute supplied script: Failed to execute supplied script: Wrapped org.alfresco.repo.security.permissions.AccessDeniedException: Access Denied. You do not have the appropriate permissions to perform this operation.
…
10-09-2008 07:33 AM
var noderef = args["noderef"];
var doc = search.findNode(noderef);
docName=doc.name;
var currentUserName = person.properties["cm:userName"];
companyhome.setPermission("CreateChildren",currentUserName);
var myNewSpace = companyhome.childByNamePath("MySpace");
if (myNewSpace == null && companyhome.hasPermission("CreateChildren"))
{
myNewSpace = companyhome.createFolder("MySpace");
}
var docExist = myNewSpace.childByNamePath(docName);
if (docExist == null)
{
var mv = doc.move(myNewSpace);
}
org.alfresco.error.AlfrescoRuntimeException: Error during command servlet processing: Access Denied. You do not have the appropriate permissions to perform this operation.
caused by: org.alfresco.repo.security.permissions.AccessDeniedException: Access Denied. You do not have the appropriate permissions to perform this operation.
caused by: net.sf.acegisecurity.AccessDeniedException: Access Denied
10-09-2008 08:11 AM
companyhome.setPermission("CreateChildren",currentUserName);
10-09-2008 11:18 AM
Now you can use an optional runas attribute on the <authentication> element to declare who the script should be run as. E.g.I'm mixed with the user/otheruser… and where do i put this to make the desired effect?! … :s
<authentication runas="otheruser">user</authentication>
<config>
<actions>
<action id="myScript">
<label>Move File …</label>
<image>/images/icons/myImage.gif</image>
<script>/Company Home/Data Dictionary/Scripts/myscript.js</script>
<params>
<param name="noderef">#{actionContext.nodeRef}</param>
</params>
</action>
</actions>
</config>
<config evaluator="node-type" condition="my:type">
<actions>
<action-group id="document_browse_menu">
<action idref="myScript" />
</action-group>
</actions>
</config>
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.