addUserToContentRestriction method

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

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.

Implementation

Future<void> addUserToContentRestriction(
    {required String id,
    required String operationKey,
    String? key,
    String? username,
    String? accountId}) async {
  await _client.send(
    'put',
    '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,
    },
  );
}