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)); }
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.