Contributor not owner to move a content

cancel
Showing results for 
Search instead for 
Did you mean: 
jamilnour
Established Member

Contributor not owner to move a content

Jump to solution

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

1 Solution

Accepted Solutions
jamilnour
Established Member

Re: Contributor not owner to move a content

Jump 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

View solution in original post

5 Replies
afaust
Master

Re: Contributor not owner to move a content

Jump to solution

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.

jamilnour
Established Member

Re: Contributor not owner to move a content

Jump 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

jpotts
Professional

Re: Contributor not owner to move a content

Jump to solution

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.

jamilnour
Established Member

Re: Contributor not owner to move a content

Jump to solution

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

jpotts
Professional

Re: Contributor not owner to move a content

Jump to solution

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.