09-11-2015 10:10 AM
09-14-2015 06:40 AM
package org.alfresco.web.evaluator;
import org.alfresco.error.AlfrescoRuntimeException;
import org.json.simple.JSONObject;
import org.springframework.extensions.surf.support.ThreadLocalRequestContext;
/**
* Determines whether a site-based node is being accessed via the Site Document Library
*
* @author mikeh
*/
public class MyFilesBasedEvaluator extends BaseEvaluator
{
@Override
public boolean evaluate(JSONObject jsonObject)
{
String containsHome = ThreadLocalRequestContext.getRequestContext().getUri();
if(containsHome.contains("user/home") || containsHome.contains("/page/context/mine")){
return false;
}
else{
return true;
}
}
}
<!– Manage permissions (repository roles) –>
<action id="document-manage-repo-permissions" type="pagelink" icon="document-manage-permissions" label="actions.document.manage-permissions">
<param name="page">manage-permissions?nodeRef={node.nodeRef}</param>
<permissions>
<permission allow="true">ChangePermissions</permission>
</permissions>
<!– Custom evaluator to disable Manage Permissions action at My Files section
<evaluator>evaluator.doclib.action.myFilesBased</evaluator>
<evaluator negate="true">evaluator.doclib.action.siteBased</evaluator>
<evaluator negate="true">evaluator.doclib.action.isWorkingCopy</evaluator>
</action>
<bean id="evaluator.doclib.action.myFilesBased" class="org.alfresco.web.evaluator.MyFilesBasedEvaluator" />
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.