cancel
Showing results for 
Search instead for 
Did you mean: 

how to view actions depending on user??

massanen
Champ in-the-making
Champ in-the-making
Hi everybody,

I've created a set of actions as a buttons under a folder (or space), and I want that every user could see only specific actions (not all the actions).

For example:

The user "Teacher" creates a folder in the space "CREATION". Under this folder it has to be a button "move to edition".
After that, an "Editor" will view this folder in his own space, and under the folder now it has to appear an action "move to revision". The same folder that the teacher has created, but another actoin.

I hope you understand me…

I've tryed to manage the permissions, but nothing, and in some topic there is an example that it doesn't work. What I've tried to do is a simple java function that if the space has de permission of "Creation" (for example), it returns true or false:

package alfresco.web.action.evaluator;

import org.alfresco.web.action.evaluator.BaseActionEvaluator;
import org.alfresco.web.bean.repository.Node;

public class CompruevaCreacion extends BaseActionEvaluator {
   public boolean creacion(Node node){
      boolean ok=false;
      if(node.hasPermission("Creacion")) ok=true;
      return ok;
   }
}

and my web-client-config-custom.xml:

<action id="moveToEdicion">
            <permissions>
               <permission allow="true">Creacion</permission>
            </permissions>
            <evaluator>org.alfresco.web.action.evaluator.BaseAactionEvaluator.CompruevaCreacion</evaluator>
            <label>Mover la carpeta a edicion</label>
            <image>/images/icons/edit_form.gif</image>
            <tooltip>Mover estado</tooltip>
            <script>/Company Home/Data Dictionary/Scripts/cM_mouEdicion.js</script>
            <params>
               <param name="id">#{actionContext.id}</param>
            </params>
         </action>

But nothing. Or I see all the actions under the folder, or none of them. But I can't make that only some accions are viewed for only some users in the same folder…

Can anybody help me??

thanks a lot!
1 REPLY 1

openpj
Elite Collaborator
Elite Collaborator
Try to change the permission to CreateChildren, I think that you need to set one of the base permissions of Alfresco in the XML element.

Hope this helps.