Hello,
As contributor and not the owner of a content I want to move the content from folder to another folder inside a site. The manager of the site is the owner of the content.The move action is fired from a rule on a folder created by the manager
What is the best solution for this scenario
Thanks
Jamil
Solved! Go to Solution.
Yes, my idea is to create my own java actionExecuter (AdminMove) with a parameter the destination folder and perform the move of the content node with the Admin privilege using AuthenticationUtil.runAsSystem().
This AdminMove will be shown in the list of the rules action and can be called to perform a force move
Is this ok?
Any security issue?
Thanks
Jamil
There is no way to achieve this with just Contributor privileges. Moving an item requires delete privileges on the item to move, and a Contributor by definition does not have that. If not the owner you would need to be a Site Administrator to be allowed to move an item. Given the default permission model of Alfresco there also is no way to allow a move without granting delete privileges.
In Java code you could technically perform a piece of an action with elevated privileges via the AuthenticationUtil.runAsSystem() utility. But that is not easily available in scripts triggered by a rule.
Yes, my idea is to create my own java actionExecuter (AdminMove) with a parameter the destination folder and perform the move of the content node with the Admin privilege using AuthenticationUtil.runAsSystem().
This AdminMove will be shown in the list of the rules action and can be called to perform a force move
Is this ok?
Any security issue?
Thanks
Jamil
As long as you are okay with anyone being able to move any piece of content in your repository to any folder of their choosing, there is no issue.
You might want to add some logic in your action to check the destination so that you exclude targets such as the Data Dictionary, or maybe only allow targets that are Share sites or something like that.
Okay great...
One more question please. I created the custom actionExecuter with one parameter the destinationFolder. I can see and select it in the list of rules actions.
My question is how to show the user the select button to choose and auto fill the destinationFolder? Right now I can see an input field which is not practical to fill by hand
Thanks
Jamil
Take a look at this tutorial:
http://ecmarchitect.com/alfresco-developer-series-tutorials/actions/tutorial/tutorial.html
In it, a custom action is implemented that needs a destination node
reference. The tutorial overrides some web scripts and client-side
JavaScript to implement the control.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.