Class Target
- java.lang.Object
-
- com.atlassian.confluence.api.model.permissions.Target
-
- Direct Known Subclasses:
Target.ContainerTarget
,Target.IdTarget
,Target.ModelObjectTarget
@ExperimentalApi public abstract class Target extends Object
The target for an operation permissions check.- Since:
- 5.8
- See Also:
OperationService
,OperationCheck
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Target.ContainerTarget
A target for a container being used to check operations on a different target type within it.static class
Target.IdTarget
A light weight target that only contain id of the object.static class
Target.ModelObjectTarget
A target that points to a single model object, e.g.
-
Field Summary
Fields Modifier and Type Field Description protected TargetType
targetType
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
equals(@Nullable Object o)
static Target
forChildrenOfContainer(Container container, TargetType childTargetType)
Create aTarget
for a container being used to check operations on a different childTargetType
within it.static Target
forContentId(ContentId id, TargetType type)
Create aTarget
from content idstatic Target
forModelObject(Object modelObject)
Create aTarget
that points to a single model object, e.g.@NonNull TargetType
getTargetType()
Get theTargetType
for this model object.int
hashCode()
static Target
targetForModelObject(Object modelObject)
Deprecated.since 5.9static Target
targetInContainer(Container container, TargetType childTargetType)
Deprecated.since 5.9
-
-
-
Field Detail
-
targetType
protected final TargetType targetType
-
-
Method Detail
-
targetForModelObject
@Deprecated public static Target targetForModelObject(Object modelObject)
Deprecated.since 5.9- Parameters:
modelObject
- an API-layer model object (for example, aContent
)- Throws:
IllegalArgumentException
- if modelObject is an unsupported type
-
targetInContainer
@Deprecated public static Target targetInContainer(Container container, TargetType childTargetType)
Deprecated.since 5.9Create aTarget
for a container being used to check operations on a different childTargetType
within it.For example, a
ContentType.PAGE
container used to check operations on containedTargetType.COMMENT
s.- Parameters:
container
- an API-layer model object (for example, aContent
) that is a container of other targetschildTargetType
- theTargetType
(different from that of the container) whose permissions will be checked within the container- Throws:
IllegalArgumentException
- if container is an unsupported type
-
forModelObject
public static Target forModelObject(Object modelObject)
- Parameters:
modelObject
- an API-layer model object (for example, aContent
)- Throws:
IllegalArgumentException
- if modelObject is an unsupported type
-
forChildrenOfContainer
public static Target forChildrenOfContainer(Container container, TargetType childTargetType)
Create aTarget
for a container being used to check operations on a different childTargetType
within it.For example, a
ContentType.PAGE
container used to check operations on containedTargetType.COMMENT
s.- Parameters:
container
- an API-layer model object (for example, aContent
) that is a container of other targetschildTargetType
- theTargetType
(different from that of the container) whose permissions will be checked within the container- Throws:
IllegalArgumentException
- if container is an unsupported type
-
forContentId
public static Target forContentId(ContentId id, TargetType type)
Create aTarget
from content id- Parameters:
id
- id of content object- Returns:
- target object
-
getTargetType
public final @NonNull TargetType getTargetType()
Get theTargetType
for this model object.This determines the type of
OperationCheck
to perform.
-
-