Package org.nuxeo.ecm.permissions
Class PermissionGrantedNotificationListener
- java.lang.Object
-
- org.nuxeo.ecm.permissions.PermissionGrantedNotificationListener
-
- All Implemented Interfaces:
PostCommitEventListener,PostCommitFilteringEventListener
public class PermissionGrantedNotificationListener extends Object implements PostCommitFilteringEventListener
Listener sending an email notification for a granted ACE.This listener checks only if the ACE is granted. It assumes that other checks (such as the ACE becomes effective) have been done before.
- Since:
- 7.4
-
-
Field Summary
Fields Modifier and Type Field Description static StringLABEL_SUBJECT_NEW_PERMISSIONstatic StringSUBJECT_FORMAT
-
Constructor Summary
Constructors Constructor Description PermissionGrantedNotificationListener()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanacceptEvent(Event event)Checks if this event is worth passing to the asynchronousPostCommitEventListener.handleEvent(org.nuxeo.ecm.core.event.EventBundle).protected StringListgetRecipients(String username)protected voidhandleEvent(Event event)voidhandleEvent(EventBundle events)Handles the set of events that were raised during the life of an user operation.static StringprincipalFullName(NuxeoPrincipal principal)static StringuserDisplayName(String id, String first, String last)
-
-
-
Field Detail
-
LABEL_SUBJECT_NEW_PERMISSION
public static final String LABEL_SUBJECT_NEW_PERMISSION
- See Also:
- Constant Field Values
-
SUBJECT_FORMAT
public static final String SUBJECT_FORMAT
- See Also:
- Constant Field Values
-
-
Method Detail
-
handleEvent
public void handleEvent(EventBundle events)
Description copied from interface:PostCommitEventListenerHandles the set of events that were raised during the life of an user operation.The events are fired as a
BundleEventafter the transaction is committed.- Specified by:
handleEventin interfacePostCommitEventListener- Parameters:
events- the events to handle
-
handleEvent
protected void handleEvent(Event event)
-
principalFullName
public static String principalFullName(NuxeoPrincipal principal)
-
getRecipients
protected StringList getRecipients(String username)
-
acceptEvent
public boolean acceptEvent(Event event)
Description copied from interface:PostCommitFilteringEventListenerChecks if this event is worth passing to the asynchronousPostCommitEventListener.handleEvent(org.nuxeo.ecm.core.event.EventBundle).Note that the event's documents are usually disconnected into
ShallowDocumentModelinstances, which means that this method may not be able to get to all the information it would get from a standard DocumentModel implementation. If there is not enough information in the ShallowDocumentModel to decide whether this event is of interest, then this method should accept it an let the actual logic done inPostCommitEventListener.handleEvent(org.nuxeo.ecm.core.event.EventBundle)do the final filtering.- Specified by:
acceptEventin interfacePostCommitFilteringEventListener- Parameters:
event- the event- Returns:
trueto accept it, orfalseto ignore it
-
-