Class ProjectPermissionRevocationRequestedEvent
java.lang.Object
java.util.EventObject
com.atlassian.bitbucket.event.ApplicationEvent
com.atlassian.bitbucket.event.permission.PermissionEvent
com.atlassian.bitbucket.event.permission.ProjectPermissionEvent
com.atlassian.bitbucket.event.permission.ProjectPermissionRevocationRequestedEvent
- All Implemented Interfaces:
CancelableEvent
,PermissionRevocationRequestedEvent
,CancelState
,Serializable
@TransactionAware(IMMEDIATE)
public class ProjectPermissionRevocationRequestedEvent
extends ProjectPermissionEvent
implements PermissionRevocationRequestedEvent
This event is raised before a user or group's project permission is revoked. This event is synchronous,
allowing listeners to perform operations in the same database transaction where the permission is revoked.
This event is cancelable
. A listener may prevent the permission
from being revoked by canceling
this event.
Throwing an exception will not prevent the permission from being revoked;
the exception will be logged and ignored.
This event is internally audited with CoverageLevel.BASE
level.
- See Also:
-
Field Summary
Fields inherited from class java.util.EventObject
source
-
Constructor Summary
ConstructorDescriptionProjectPermissionRevocationRequestedEvent
(Object source, Permission permission, Project project, String affectedGroup, ApplicationUser affectedUser, CancelState cancelState) -
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel
(KeyedMessage message) Cancels the operation, providing a message explaining why.boolean
Retrieves a flag indicating whether the operation has been canceled.Methods inherited from class com.atlassian.bitbucket.event.permission.ProjectPermissionEvent
getProject
Methods inherited from class com.atlassian.bitbucket.event.permission.PermissionEvent
getAffectedGroup, getAffectedUser, getPermission
Methods inherited from class com.atlassian.bitbucket.event.ApplicationEvent
getDate, getUser
Methods inherited from class java.util.EventObject
getSource, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.atlassian.bitbucket.event.permission.PermissionRevocationRequestedEvent
getPermission
-
Constructor Details
-
ProjectPermissionRevocationRequestedEvent
public ProjectPermissionRevocationRequestedEvent(@Nonnull Object source, @Nonnull Permission permission, @Nonnull Project project, @Nullable String affectedGroup, @Nullable ApplicationUser affectedUser, @Nonnull CancelState cancelState)
-
-
Method Details
-
cancel
Description copied from interface:CancelState
Cancels the operation, providing a message explaining why.The cancellation message is required, and should be as descriptive and clear as possible to allow end users to correct, if possible, the issue that triggered cancellation.
- Specified by:
cancel
in interfaceCancelState
- Parameters:
message
- a descriptive message explaining why the operation has been canceled
-
isCanceled
public boolean isCanceled()Description copied from interface:CancelState
Retrieves a flag indicating whether the operation has been canceled.In situations where multiple observers have the option to cancel an operation, for example when multiple listeners receive the same
CancelableEvent
, this flag can be useful for determining that another observer has already canceled the operation.- Specified by:
isCanceled
in interfaceCancelState
- Returns:
true
if the operation has beencanceled
; otherwise,false
-