Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save douglascrp/3a66190e2120ff572277103bd66857ed to your computer and use it in GitHub Desktop.
Save douglascrp/3a66190e2120ff572277103bd66857ed to your computer and use it in GitHub Desktop.
Disable alfresco policy in Javascript.js
var context = Packages.org.springframework.web.context.ContextLoader.getCurrentWebApplicationContext();
var model = Packages.br.com.dgcloud.model.CustomerXModel;
var policyBehaviourFilter = context.getBean('policyBehaviourFilter', Packages.org.alfresco.repo.policy.BehaviourFilter);
try {
policyBehaviourFilter.disableBehaviour(node.nodeRef, model.TYPE_DOCUMENT_EMPLOYEE_QNAME);
// your code here
} finally {
policyBehaviourFilter.enableBehaviour(node.nodeRef, model.TYPE_DOCUMENT_EMPPLOYEE_QNAME);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment