updatePermissionScheme method

Future<PermissionScheme> updatePermissionScheme({
  1. required int schemeId,
  2. String? expand,
  3. required PermissionScheme body,
})

Updates a permission scheme. Below are some important things to note when using this resource:

  • If a permissions list is present in the request, then it is set in the permission scheme, overwriting all existing grants.
  • If you want to update only the name and description, then do not send a permissions list in the request.
  • Sending an empty list will remove all permission grants from the permission scheme.

If you want to add or delete a permission grant instead of updating the whole list, see Create permission grant or Delete permission scheme entity.

See About permission schemes and grants for more details.

Permissions required: Administer Jira global permission.

Implementation

Future<PermissionScheme> updatePermissionScheme(
    {required int schemeId,
    String? expand,
    required PermissionScheme body}) async {
  return PermissionScheme.fromJson(await _client.send(
    'put',
    'rest/api/3/permissionscheme/{schemeId}',
    pathParameters: {
      'schemeId': '$schemeId',
    },
    queryParameters: {
      if (expand != null) 'expand': expand,
    },
    body: body.toJson(),
  ));
}