Document actions based on user rights/role

cancel
Showing results for 
Search instead for 
Did you mean: 
douglascrp
Advanced II

Re: Document actions based on user rights/role

zputnoky
Established Member

Re: Document actions based on user rights/role

I do not recall this evaluator. Might be a mistake somewhere. Here is what we try to do for our proof-of-concept:

An Alfresco Share site represents a project. We have more than one projects running in the same time

The company has few departments, 4 of them are doing specific project related works, 3 of them are support departments

The teams in each department are assigned to different projects, and with different roles. In one project User A can be a manager (or responsable) while the same person can be a simple user of content in the other project. Because of this, I was thinking to use user role assignment per site/folder to show/hide the different actions. A user can have one of the three - manager, contributor, user - role. Since we try to use Alfresco to manage certain type of engineering documentation and our processes (the next step is Activiti process development/implementation) are rather specific, we were able to create action groups (from document browser, document details view) for each of the three available roles. The goal is to avoid confusion and to make sure that the system is simple enough for the users. If not, they wont use it!

I tried to use an evaluator to check the user role (isSiteManager, isSiteConsumer, etc) and use the disableAction in case the evaluator returns True. Unfortunately this was not working.

The easiest solution would be to remove the unnecessary actions for all the users. But we voted against this solution.

Hope it makes things a bit more clear.

Regards,


Zsolt Putnoky

angelborroy
Alfresco Employee

Re: Document actions based on user rights/role

Below a simple guide to implement such a feature.

1 - Create three different modules at https://github.com/keensoft/alfresco-simplify-share/blob/master/simplify-share/src/main/amp/config/a... including an evaluator for each one

<evaluator type="site.module.evaluator">
    <params>
        <sites>.*</sites>
        <applyForNonSites>false</applyForNonSites>
        <groups>SiteCollaborator</groups>
        <groupsRelation>OR</groupsRelation>
    </params>
</evaluator>

2 - Include for every module desired actions at https://github.com/keensoft/alfresco-simplify-share/blob/master/simplify-share/src/main/amp/config/a...

<actionGroup id="document-browse">
    <action index="100" id="document-download" appendEvaluators="true">
        <evaluator>evaluator.doclib.action.DocumentEnableInSmartFolder</evaluator>
    </action>
    <action index="110" id="document-view-content" appendEvaluators="true">
        <evaluator>evaluator.doclib.action.DocumentEnableInSmartFolder</evaluator>
    </action>
    <action index="120" id="document-locate" appendEvaluators="true">
        <evaluator>evaluator.doclib.action.DocumentEnableInSmartFolder</evaluator>
    </action>

</actionGroup>

...

3 - Create three different modules at https://github.com/keensoft/alfresco-simplify-share/blob/master/simplify-share/src/main/amp/config/a... including an evaluator for each one

<evaluator type="site.module.evaluator">
    <params>
        <sites>.*</sites>
        <applyForNonSites>false</applyForNonSites>
        <groups>SiteCollaborator</groups>
        <groupsRelation>OR</groupsRelation>
    </params>
</evaluator>

4 - Select which components are you rendering for every module at section https://github.com/keensoft/alfresco-simplify-share/blob/master/simplify-share/src/main/amp/config/a... 

5 - Identify other conditions to render or not regions at https://github.com/keensoft/alfresco-simplify-share/blob/master/simplify-share/src/main/amp/config/a... 

I understand your requirement and I hope you understand how to implement it easily with this instructions.

Hyland Developer Evangelist
zputnoky
Established Member

Re: Document actions based on user rights/role

Thanks alot! I think I start to understand it. time to print and read it on the train