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 classTarget.ContainerTargetA target for a container being used to check operations on a different target type within it.static classTarget.IdTargetA light weight target that only contain id of the object.static classTarget.ModelObjectTargetA target that points to a single model object, e.g.
-
Field Summary
Fields Modifier and Type Field Description protected TargetTypetargetType
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanequals(@Nullable Object o)static TargetforChildrenOfContainer(Container container, TargetType childTargetType)Create aTargetfor a container being used to check operations on a different childTargetTypewithin it.static TargetforContentId(ContentId id, TargetType type)Create aTargetfrom content idstatic TargetforModelObject(Object modelObject)Create aTargetthat points to a single model object, e.g.@NonNull TargetTypegetTargetType()Get theTargetTypefor this model object.inthashCode()static TargettargetForModelObject(Object modelObject)Deprecated.since 5.9static TargettargetInContainer(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 aTargetfor a container being used to check operations on a different childTargetTypewithin it.For example, a
ContentType.PAGEcontainer used to check operations on containedTargetType.COMMENTs.- 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 aTargetfor a container being used to check operations on a different childTargetTypewithin it.For example, a
ContentType.PAGEcontainer used to check operations on containedTargetType.COMMENTs.- 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 aTargetfrom content id- Parameters:
id- id of content object- Returns:
- target object
-
getTargetType
public final @NonNull TargetType getTargetType()
Get theTargetTypefor this model object.This determines the type of
OperationCheckto perform.
-
-