Chelabase
ManagementTeams

Give a team access to a project

PUT
/v1/teams/{team_id}/grants/{project_id}

Creates or replaces the team's grant on the project; its members get it live, beside their own grants (each Postgres role at the level of the grant naming it). admin holds every role (the names in pg_roles are checked, then dropped). The grant is checked on every member's union of sources narrowed by their overrides, on every database of the project, as putProjectGrant checks one grant; a refusal names the member, the team and the database. Personal logins that stop qualifying are revoked, and every branch of the project reconciles its member roles. An unchanged grant writes nothing.

Authorization

bearer
AuthorizationBearer <token>

In: header

Path Parameters

team_id*string

Team id

Formatuuid
project_id*string

Project id

Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

pg_roles?array<string>

Postgres role names; for admin, which holds every role (R17), checked and dropped. Never owner or the database's owner, a reserved name or a personal login. Below admin, only NOLOGIN groups whose memberships reach no owner-level, LOGIN or reserved role, for every member of the team on every database (with their own grant and overrides).

platform_role*PlatformRole

A member's platform role on a project. Ordered: Viewer < Developer < Admin.

Value in

  • "viewer"
  • "developer"
  • "admin"

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PUT "https://example.com/v1/teams/497f6eca-6276-4993-bfeb-53cbbbba6f08/grants/497f6eca-6276-4993-bfeb-53cbbbba6f08" \  -H "Content-Type: application/json" \  -d '{    "platform_role": "viewer"  }'
{  "created_at": "2019-08-24T14:15:22Z",  "description": "string",  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "member_count": 0,  "member_ids": [    "6059d331-91d8-43de-a6af-f1a743933a5b"  ],  "name": "string",  "projects": [    {      "pg_roles": [        "string"      ],      "platform_role": "viewer",      "project_id": "405d8375-3514-403b-8c43-83ae74cfe0e9"    }  ],  "updated_at": "2019-08-24T14:15:22Z"}