@TransactionAware(value=IMMEDIATE) public class RepositoryPermissionModificationRequestedEvent extends AbstractRepositoryPermissionModificationEvent implements PermissionModificationRequestedEvent
This event is cancelable
. A listener may prevent the permission
from being modified by canceling
this event.
Throwing an exception will not prevent the permission from being modified;
the exception will be logged and ignored.
This event is internally audited with CoverageLevel.BASE
level.
source
Constructor and Description |
---|
RepositoryPermissionModificationRequestedEvent(Object source,
Permission oldValue,
Permission newValue,
Repository repository,
String affectedGroup,
ApplicationUser affectedUser,
CancelState cancelState) |
Modifier and Type | Method and Description |
---|---|
void |
cancel(KeyedMessage message)
Cancels the operation, providing a message explaining why.
|
boolean |
isCanceled()
Retrieves a flag indicating whether the operation has been canceled.
|
getNewValue, getOldValue
getRepository
getAffectedGroup, getAffectedUser, getPermission
getDate, getUser
getSource, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getNewValue, getOldValue
public RepositoryPermissionModificationRequestedEvent(@Nonnull Object source, @Nonnull Permission oldValue, @Nonnull Permission newValue, @Nonnull Repository repository, @Nullable String affectedGroup, @Nullable ApplicationUser affectedUser, @Nonnull CancelState cancelState)
public void cancel(@Nonnull KeyedMessage message)
CancelState
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.
cancel
in interface CancelState
message
- a descriptive message explaining why the operation has been canceledpublic boolean isCanceled()
CancelState
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.
isCanceled
in interface CancelState
true
if the operation has been canceled
; otherwise, false
Copyright © 2022 Atlassian. All rights reserved.