getContentRestrictionStatusForUser method

Future<void> getContentRestrictionStatusForUser({
  1. required String id,
  2. required String operationKey,
  3. String? key,
  4. String? username,
  5. String? accountId,
})

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.

Implementation

Future<void> getContentRestrictionStatusForUser(
    {required String id,
    required String operationKey,
    String? key,
    String? username,
    String? accountId}) async {
  await _client.send(
    'get',
    'wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/user',
    pathParameters: {
      'id': id,
      'operationKey': operationKey,
    },
    queryParameters: {
      if (key != null) 'key': key,
      if (username != null) 'username': username,
      if (accountId != null) 'accountId': accountId,
    },
  );
}