As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
Hello,
is there a way to notify users with an email when user's granted permission to see a file.
Thanks in advance.
Nothing ootb, however you can implement a custom behavior using PermissionServicePolicies.
org.alfresco.repo.security.permissions.PermissionServicePolicies org.alfresco.repo.security.permissions.PermissionServicePolicies.OnGrantLocalPermission
You must be using alfresco version 5.2.g and above in order to use PermissionServicePolicies , this class was not available before alfresco 5.2.g if i remember correctly.
Example:
public class PermissionChangeBehavior implements PermissionServicePolicies.OnGrantLocalPermission, InitializingBean { private static Log logger = LogFactory.getLog(PermissionChangeBehavior.class); private PolicyComponent policyComponent; @Override public void onGrantLocalPermission(final NodeRef nodeRef, final String authority, final String permission) { logger.info("onGrantLocalPermission invoked for nodeRef: " + nodeRef + " | authority: " + authority + " | permission: " + permission); // TODO:: Notify the user/group (authority) via email } public void setPolicyComponent(final PolicyComponent policyComponent) { this.policyComponent = policyComponent; } @Override public void afterPropertiesSet() throws Exception { policyComponent.bindClassBehaviour(PermissionServicePolicies.OnGrantLocalPermission.QNAME, ContentModel.TYPE_CONTENT, new JavaBehaviour(this, PermissionServicePolicies.OnGrantLocalPermission.QNAME.getLocalName(), NotificationFrequency.EVERY_EVENT)); }