Modify a project member's permissions

This call edits a user's permissions in a specified project. It can only be successfully made by a user who has admin permissions in the project.

👍

PUT and PATCH

The Seven Bridges Platform API has two method to modify project members' permissions. This method uses the HTTP verb PATCH, and the other uses the HTTP verb PUT.

The difference between the two concerns the way that they update the information stored about the user. PATCH allows you to update just one part of the user's information --- for instance, just the value stored for the user's copy permission. On the other hand, a PUT request will fully overwrite the user's permission information. This means that when issuing a PUT request you must enter values for every key required to describe the user, even if the values for some keys are unchanged.

Request

https://api.sbgenomics.com/v2/projects/{project_owner}/{project}/members/{member}/permissions
https://eu-api.sbgenomics.com/v2/projects/{project_owner}/{project}/members/{member}/permissions

Example request

PATCH /v2/projects/RFranklin/test/members/crick/permissions HTTP/1.1
Host: api.sbgenomics.com
X-SBG-Auth-Token: 3259c50e1ac5426ea8f1273259740f74
curl --data '{"write": true}'  -s -H "X-SBG-Auth-Token: 7942f56901534434a054dafc3813bc96" -H "content-type: application/json" -X PATCH "https://api.sbgenomics.com/v2/projects/RFranklin/test/members/crick/permissions"
from sevenbridges import Api

api = Api(url='https://api.sbgenomics.com/v2',
          token='3259c50e1ac5426ea8f1273259740f74')

project = api.projects.get(id='RFranklin/test')
member = project.get_member(username='crick')

# change permissions
member.permissions['write'] = True

# send PATCH request to SB API
member.save()

print(member.username, member.permissions)

Header Fields

Name

Description

X-SBG-Auth-Token
required

Your Seven Bridges Platform authentication token.

Path parameters

Name

Description

project

The short name of the project containing the project member.

project_owner

The owner of the project containing the project member.

member

The project member whose permissions you are editing.

Query parameters

Name

Data type

Description

fields

string

Selector specifying a subset of fields to include in the response.

Request body

Inside the body of the call you should enter a set of key-value pairs. The following table describes the values you should enter.

Key

Data type of value

Description of value

read

Boolean: true or false

User can view file names, metadata, and workflows. They cannot view file contents.

All members of a project have read permissions by default. Even if you try setting read permissions to false, they will still default to true.

write

Boolean: true or false

User can add, modify, and remove files and workflows in a project.

Set value to true to assign the user write permission. Set to false to remove write permission.

copy

Boolean: true or false

User can view file content, copy, and download files from a project.

Set value to true to assign the user copy permission. Set to false to remove copy permission.

execute

Boolean: true or false

User can execute workflows and abort tasks in a project.

Set value to true to assign the user execute permission. Set to false to remove execute permission.

admin

Boolean: true or false

User can modify another user's permissions on a project, add or remove people from the project and manage funding sources. They also have all of the above permissions.

Set value to true to assign the user admin permission. Set to false to remove admin permission.

Example request body

{
      "write": true,
}

Response

See a list of Seven Bridges Platform-specific response codes that may be contained in the body of the response.

Example response body

{
  "write": true,
  "read": true,
  "copy": false,
  "execute": false,
  "admin": false
}