@ExperimentalSpi public interface OperationCheck extends Operation
OperationService
.
Implementers are encouraged to extend BaseOperationCheck
.
BaseOperationCheck
Modifier and Type | Method and Description |
---|---|
Map<Target,ValidationResult> |
canPerform(Person person,
Iterable<Target> targets)
Check whether the specified Person can perform this operation on ALL of the specified targets.
|
ValidationResult |
canPerform(Person person,
Target target)
Check whether the specified Person can perform this operation on the specified target.
|
Map<Target,ValidationResult> |
canPerformAccordingToState(Person person,
Iterable<Target> targets)
Check whether the specified Person can perform this operation on each of the specified targets based on their state.
|
ValidationResult |
canPerformAccordingToState(Person person,
Target target)
Check whether the specified Person can perform this operation on the specified target based on its state.
|
OperationKey |
getOperationKey() |
@Nonnull OperationKey getOperationKey()
getOperationKey
in interface Operation
@Nonnull ValidationResult canPerform(Person person, Target target)
person
- the Person on which to perform a permission and validation checktarget
- the Target to check permission forNullPointerException
- if person or targets is nullIllegalArgumentException
- if target is the wrong
TargetType
for this OperationCheck
UnsupportedTargetException
- if target points to the wrong kind of object for this operation check.BadRequestException
@Nonnull ValidationResult canPerformAccordingToState(Person person, Target target)
This method must not check permissions, except when the state check depends on the result of a permission check.
"Is this target in a state where this operation makes sense?"
person
- the Person on which to perform a permission and validation checktarget
- the Target to check permission forNullPointerException
- if person or targets is nullIllegalArgumentException
- if target is the wrong
TargetType
for this OperationCheck
UnsupportedTargetException
- if target points to the wrong kind of object for this operation check.BadRequestException
@Nonnull Map<Target,ValidationResult> canPerform(Person person, Iterable<Target> targets)
person
- the Person on which to perform a permission and validation checktargets
- the Targets to check permission for;
must all be of the same TargetType
ValidationResult
for each of the supplied targets. Results for each target will
be as follows:
NullPointerException
- if person or targets is null, or any target is nullIllegalArgumentException
- if targets is empty, or if any target is the wrong
TargetType
for this OperationCheck
UnsupportedTargetException
- if any target points to the wrong kind of object for this operation check.BadRequestException
@Nonnull Map<Target,ValidationResult> canPerformAccordingToState(Person person, Iterable<Target> targets)
This method must not check permissions, except when the state check depends on the result of a permission check.
person
- the Person on which to perform a permission and validation checktargets
- the Targets to check state for;
must all be of the same TargetType
ValidationResult
for each of the supplied targets. Results for each target will
be as follows:
NullPointerException
- if person or targets is null, or any target is nullIllegalArgumentException
- if targets is empty, or if any target is the wrong
TargetType
for this OperationCheck
UnsupportedTargetException
- if any target points to the wrong kind of object for this operation check.BadRequestException
Copyright © 2003–2016 Atlassian. All rights reserved.