Hierarchy

  • CommonHttpService
    • ContentRestrictionsService

Constructors

  • Internal

    Create a new instance of the service.

    Parameters

    • getClientInstance: (() => CommonHttpClient)
        • (): CommonHttpClient
        • Returns CommonHttpClient

    Returns ContentRestrictionsService

Methods

  • Adds a group to a content restriction by Group Id. That is, grant read or update permission to the group for a piece of content.

    Permissions required: Permission to edit the content.

    Parameters

    • params: {
          groupId: string;
          id: string;
          operationKey: "update" | "read";
      }
      • groupId: string

        The groupId of the group to add to the content restriction.

      • id: string

        The ID of the content that the restriction applies to.

      • operationKey: "update" | "read"

        The operation that the restriction applies to.

    Returns Promise<void>

    PUT /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/byGroupId/{groupId} @scopes-current write:confluence-content @scopes-beta write:content.restriction:confluence

  • Adds restrictions to a piece of content. Note, this does not change any existing restrictions on the content.

    Permissions required: Permission to edit the content.

    Parameters

    • params: {
          contentRestrictionAddOrUpdateArray: ContentRestrictionAddOrUpdateArray;
          expand?: (
              | "content"
              | "restrictions.user"
              | "read.restrictions.user"
              | "update.restrictions.user"
              | "restrictions.group"
              | "read.restrictions.group"
              | "update.restrictions.group")[];
          id: string;
      }
      • contentRestrictionAddOrUpdateArray: ContentRestrictionAddOrUpdateArray

        The restrictions to be added to the content.

      • Optionalexpand?: (
            | "content"
            | "restrictions.user"
            | "read.restrictions.user"
            | "update.restrictions.user"
            | "restrictions.group"
            | "read.restrictions.group"
            | "update.restrictions.group")[]

        A multi-value parameter indicating which properties of the content restrictions (returned in response) to expand.

        • restrictions.user returns the piece of content that the restrictions are applied to. Expanded by default.
        • restrictions.group returns the piece of content that the restrictions are applied to. Expanded by default.
        • content returns the piece of content that the restrictions are applied to.
      • id: string

        The ID of the content to add restrictions to.

    Returns Promise<ContentRestrictionArray>

    Returned if the requested restrictions are added.

    POST /wiki/rest/api/content/{id}/restriction @scopes-current write:confluence-content @scopes-beta read:content-details:confluence, write:content.restriction:confluence

  • Adds a user to a content restriction. That is, grant read or update permission to the user for a piece of content.

    Permissions required: Permission to edit the content.

    Parameters

    • params: {
          accountId?: string;
          id: string;
          key?: string;
          operationKey: string;
          username?: string;
      }
      • OptionalaccountId?: string

        The account ID of the user. The accountId uniquely identifies the user across all Atlassian products. For example, 384093:32b4d9w0-f6a5-3535-11a3-9c8c88d10192.

      • id: string

        The ID of the content that the restriction applies to.

      • Optionalkey?: string

        This parameter is no longer available and will be removed from the documentation soon. Use accountId instead. See the deprecation notice for details.

      • operationKey: string

        The operation that the restriction applies to.

      • Optionalusername?: string

        This parameter is no longer available and will be removed from the documentation soon. Use accountId instead. See the deprecation notice for details.

    Returns Promise<void>

    PUT /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/user @scopes-current write:confluence-content @scopes-beta write:content.restriction:confluence

  • Removes all restrictions (read and update) on a piece of content.

    Permissions required: Permission to edit the content.

    Parameters

    • params: {
          expand?: (
              | "content"
              | "restrictions.user"
              | "read.restrictions.user"
              | "update.restrictions.user"
              | "restrictions.group"
              | "read.restrictions.group"
              | "update.restrictions.group")[];
          id: string;
      }
      • Optionalexpand?: (
            | "content"
            | "restrictions.user"
            | "read.restrictions.user"
            | "update.restrictions.user"
            | "restrictions.group"
            | "read.restrictions.group"
            | "update.restrictions.group")[]

        A multi-value parameter indicating which properties of the content restrictions (returned in response) to expand.

        • restrictions.user returns the piece of content that the restrictions are applied to. Expanded by default.
        • restrictions.group returns the piece of content that the restrictions are applied to. Expanded by default.
        • content returns the piece of content that the restrictions are applied to.
      • id: string

        The ID of the content to remove restrictions from.

    Returns Promise<ContentRestrictionArray>

    Returned if the restrictions are removed.

    DELETE /wiki/rest/api/content/{id}/restriction @scopes-current write:confluence-content @scopes-beta read:content-details:confluence, write:content.restriction:confluence

  • Returns whether the specified content restriction applies to a user. For example, if a page with id=123 has a read restriction for a user with an account ID of 384093:32b4d9w0-f6a5-3535-11a3-9c8c88d10192, the following request will return true:

    /wiki/rest/api/content/123/restriction/byOperation/read/user?accountId=384093:32b4d9w0-f6a5-3535-11a3-9c8c88d10192

    Note that a response of true does not guarantee that the user can view the page, as it does not account for account-inherited restrictions, space permissions, or even product access. For more information, see Confluence permissions.

    Permissions required: Permission to view the content.

    Parameters

    • params: {
          accountId?: string;
          id: string;
          key?: string;
          operationKey: string;
          username?: string;
      }
      • OptionalaccountId?: string

        The account ID of the user. The accountId uniquely identifies the user across all Atlassian products. For example, 384093:32b4d9w0-f6a5-3535-11a3-9c8c88d10192.

      • id: string

        The ID of the content that the restriction applies to.

      • Optionalkey?: string

        This parameter is no longer available and will be removed from the documentation soon. Use accountId instead. See the deprecation notice for details.

      • operationKey: string

        The operation that is restricted.

      • Optionalusername?: string

        This parameter is no longer available and will be removed from the documentation soon. Use accountId instead. See the deprecation notice for details.

    Returns Promise<void>

    GET /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/user @scopes-current read:confluence-content.all @scopes-beta read:content.restriction:confluence

  • Returns whether the specified content restriction applies to a group. For example, if a page with id=123 has a read restriction for the 123456 group id, the following request will return true:

    /wiki/rest/api/content/123/restriction/byOperation/read/byGroupId/123456

    Note that a response of true does not guarantee that the group can view the page, as it does not account for account-inherited restrictions, space permissions, or even product access. For more information, see Confluence permissions.

    Permissions required: Permission to view the content.

    Parameters

    • params: {
          groupId: string;
          id: string;
          operationKey: "update" | "read";
      }
      • groupId: string

        The id of the group to be queried for whether the content restriction applies to it.

      • id: string

        The ID of the content that the restriction applies to.

      • operationKey: "update" | "read"

        The operation that the restriction applies to.

    Returns Promise<void>

    GET /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/byGroupId/{groupId} @scopes-current read:confluence-content.all @scopes-beta read:content.restriction:confluence

  • Returns the restrictions on a piece of content.

    Permissions required: Permission to view the content.

    Parameters

    • params: {
          expand?: (
              | "content"
              | "restrictions.user"
              | "read.restrictions.user"
              | "update.restrictions.user"
              | "restrictions.group"
              | "read.restrictions.group"
              | "update.restrictions.group")[];
          id: string;
          limit?: number;
          start?: number;
      }
      • Optionalexpand?: (
            | "content"
            | "restrictions.user"
            | "read.restrictions.user"
            | "update.restrictions.user"
            | "restrictions.group"
            | "read.restrictions.group"
            | "update.restrictions.group")[]

        A multi-value parameter indicating which properties of the content restrictions to expand. By default, the following objects are expanded: restrictions.user, restrictions.group.

        • restrictions.user returns the piece of content that the restrictions are applied to.
        • restrictions.group returns the piece of content that the restrictions are applied to.
        • content returns the piece of content that the restrictions are applied to.
      • id: string

        The ID of the content to be queried for its restrictions.

      • Optionallimit?: number

        The maximum number of users and the maximum number of groups, in the returned restrictions, to return per page. Note, this may be restricted by fixed system limits.

      • Optionalstart?: number

        The starting index of the users and groups in the returned restrictions.

    Returns Promise<ContentRestrictionArray>

    Returned if the requested restrictions are returned.

    GET /wiki/rest/api/content/{id}/restriction @scopes-current read:confluence-content.all @scopes-beta read:content-details:confluence

  • Returns restrictions on a piece of content by operation. This method is similar to Get restrictions except that the operations are properties of the return object, rather than items in a results array.

    Permissions required: Permission to view the content.

    Parameters

    • params: {
          expand?: ("content" | "restrictions.user" | "restrictions.group")[];
          id: string;
      }
      • Optionalexpand?: ("content" | "restrictions.user" | "restrictions.group")[]

        A multi-value parameter indicating which properties of the content restrictions to expand.

        • restrictions.user returns the piece of content that the restrictions are applied to. Expanded by default.
        • restrictions.group returns the piece of content that the restrictions are applied to. Expanded by default.
        • content returns the piece of content that the restrictions are applied to.
      • id: string

        The ID of the content to be queried for its restrictions.

    Returns Promise<{
        [key: string]: unknown;
    }>

    Returned if the requested restrictions are returned.

    GET /wiki/rest/api/content/{id}/restriction/byOperation @scopes-current read:confluence-content.all @scopes-beta read:content-details:confluence

  • Returns the restictions on a piece of content for a given operation (read or update).

    Permissions required: Permission to view the content.

    Parameters

    • params: {
          expand?: ("content" | "restrictions.user" | "restrictions.group")[];
          id: string;
          limit?: number;
          operationKey: "update" | "read";
          start?: number;
      }
      • Optionalexpand?: ("content" | "restrictions.user" | "restrictions.group")[]

        A multi-value parameter indicating which properties of the content restrictions to expand.

        • restrictions.user returns the piece of content that the restrictions are applied to. Expanded by default.
        • restrictions.group returns the piece of content that the restrictions are applied to. Expanded by default.
        • content returns the piece of content that the restrictions are applied to.
      • id: string

        The ID of the content to be queried for its restrictions.

      • Optionallimit?: number

        The maximum number of users and the maximum number of groups, in the returned restrictions, to return per page. Note, this may be restricted by fixed system limits.

      • operationKey: "update" | "read"

        The operation type of the restrictions to be returned.

      • Optionalstart?: number

        The starting index of the users and groups in the returned restrictions.

    Returns Promise<ContentRestriction>

    Returned if the requested restrictions are returned.

    GET /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey} @scopes-current read:confluence-content.all @scopes-beta read:content-details:confluence

  • Removes a group from a content restriction. That is, remove read or update permission for the group for a piece of content.

    Permissions required: Permission to edit the content.

    Parameters

    • params: {
          groupId: string;
          id: string;
          operationKey: "update" | "read";
      }
      • groupId: string

        The id of the group to remove from the content restriction.

      • id: string

        The ID of the content that the restriction applies to.

      • operationKey: "update" | "read"

        The operation that the restriction applies to.

    Returns Promise<void>

    DELETE /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/byGroupId/{groupId} @scopes-current write:confluence-content @scopes-beta write:content.restriction:confluence

  • Removes a group from a content restriction. That is, remove read or update permission for the group for a piece of content.

    Permissions required: Permission to edit the content.

    Parameters

    • params: {
          accountId?: string;
          id: string;
          key?: string;
          operationKey: "update" | "read";
          username?: string;
      }
      • OptionalaccountId?: string

        The account ID of the user. The accountId uniquely identifies the user across all Atlassian products. For example, 384093:32b4d9w0-f6a5-3535-11a3-9c8c88d10192.

      • id: string

        The ID of the content that the restriction applies to.

      • Optionalkey?: string

        This parameter is no longer available and will be removed from the documentation soon. Use accountId instead. See the deprecation notice for details.

      • operationKey: "update" | "read"

        The operation that the restriction applies to.

      • Optionalusername?: string

        This parameter is no longer available and will be removed from the documentation soon. Use accountId instead. See the deprecation notice for details.

    Returns Promise<void>

    DELETE /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/user @scopes-current write:confluence-content @scopes-beta write:content.restriction:confluence

  • Updates restrictions for a piece of content. This removes the existing restrictions and replaces them with the restrictions in the request.

    Permissions required: Permission to edit the content.

    Parameters

    • params: {
          contentRestrictionAddOrUpdateArray: ContentRestrictionAddOrUpdateArray;
          expand?: (
              | "content"
              | "restrictions.user"
              | "read.restrictions.user"
              | "update.restrictions.user"
              | "restrictions.group"
              | "read.restrictions.group"
              | "update.restrictions.group")[];
          id: string;
      }
      • contentRestrictionAddOrUpdateArray: ContentRestrictionAddOrUpdateArray

        The updated restrictions for the content.

      • Optionalexpand?: (
            | "content"
            | "restrictions.user"
            | "read.restrictions.user"
            | "update.restrictions.user"
            | "restrictions.group"
            | "read.restrictions.group"
            | "update.restrictions.group")[]

        A multi-value parameter indicating which properties of the content restrictions (returned in response) to expand.

        • restrictions.user returns the piece of content that the restrictions are applied to. Expanded by default.
        • restrictions.group returns the piece of content that the restrictions are applied to. Expanded by default.
        • content returns the piece of content that the restrictions are applied to.
      • id: string

        The ID of the content to update restrictions for.

    Returns Promise<ContentRestrictionArray>

    Returned if the requested restrictions are updated.

    PUT /wiki/rest/api/content/{id}/restriction @scopes-current write:confluence-content @scopes-beta read:content-details:confluence, write:content.restriction:confluence

  • Method to initialize the class. Normally used to set up validation rules.

    Returns void