java.lang.Object
com.atlassian.confluence.api.model.permissions.Target
Direct Known Subclasses:
Target.ContainerTarget, Target.IdTarget, Target.ModelObjectTarget

public abstract class Target extends Object
The target for an operation permissions check.
Since:
5.8
See Also:
  • Field Details

    • targetType

      protected final TargetType targetType
  • Method Details

    • targetForModelObject

      @Deprecated public static Target targetForModelObject(Object modelObject)
      Deprecated.
      since 5.9
      Create a Target that points to a single model object, e.g. a Content.
      Parameters:
      modelObject - an API-layer model object (for example, a Content)
      Throws:
      IllegalArgumentException - if modelObject is an unsupported type
    • targetInContainer

      @Deprecated public static Target targetInContainer(Container container, TargetType childTargetType)
      Deprecated.
      since 5.9
      Create a Target for a container being used to check operations on a different child TargetType within it.

      For example, a ContentType.PAGE container used to check operations on contained TargetType.COMMENTs.

      Parameters:
      container - an API-layer model object (for example, a Content) that is a container of other targets
      childTargetType - the TargetType (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)
      Create a Target that points to a single model object, e.g. a Content.
      Parameters:
      modelObject - an API-layer model object (for example, a Content)
      Throws:
      IllegalArgumentException - if modelObject is an unsupported type
    • forChildrenOfContainer

      public static Target forChildrenOfContainer(Container container, TargetType childTargetType)
      Create a Target for a container being used to check operations on a different child TargetType within it.

      For example, a ContentType.PAGE container used to check operations on contained TargetType.COMMENTs.

      Parameters:
      container - an API-layer model object (for example, a Content) that is a container of other targets
      childTargetType - the TargetType (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 a Target from content id
      Parameters:
      id - id of content object
      Returns:
      target object
    • getTargetType

      public final @NonNull TargetType getTargetType()
      Get the TargetType for this model object.

      This determines the type of OperationCheck to perform.

    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object