addPermissionToSpace method

Future<SpacePermissionV2> addPermissionToSpace({
  1. required String spaceKey,
  2. required SpacePermissionRequest body,
})

Adds new permission to space.

If the permission to be added is a group permission, the group can be identified by its group name or group id.

Note: Apps cannot access this REST resource - including when utilizing user impersonation.

Permissions required: 'Admin' permission for the space.

Implementation

Future<SpacePermissionV2> addPermissionToSpace(
    {required String spaceKey, required SpacePermissionRequest body}) async {
  return SpacePermissionV2.fromJson(await _client.send(
    'post',
    'wiki/rest/api/space/{spaceKey}/permission',
    pathParameters: {
      'spaceKey': spaceKey,
    },
    body: body.toJson(),
  ));
}