Dokumentation
ReferenzDirectories

Set who may reach a directory.

POST
/directories/{directoryId}/permissions

Share a directory with user groups, or stop sharing it. This is the call that gives people access to documents: a folder is shared with a group, and the people in that group reach everything in it and below it.

The body replaces the permissions of this directory. It is not an addition: a group that is not named loses the permission it had, and an empty list revokes them all. Read GET /directories/{directoryId}/permissions and send its groups back with the change applied. Permissions inherited from directories above are not touched by this and cannot be revoked here — that happens on the directory that carries them.

A group id that does not exist, or that belongs to another tenant, is skipped without an error: the call answers 200 and that group is simply not in the result. Because the body replaces the whole set, a wrong id therefore takes access away rather than granting it. The answer lists what is now set, which is what a caller should check.

Restricted directories — the personal directory of a user, staging and chat-session directories, project directories — cannot be shared and are refused. The members of a project are set with POST /projects/{projectId}/members.

Requires the manage permission on the directory: a tenant manager and an administrator hold it for every directory of their tenant, everybody else through a group that was given manage on the directory or on one above it.

Authorization

apiKey
headerX-API-Key<token>

API key issued in the Galilea settings.

Path Parameters

directoryId*string

The id of the directory, as returned by GET /directories.

Formatuuid

Request Body

application/json
  1. body

The complete set of permissions on a directory, not an addition to it. Every group that is to keep its access has to be named; a group that is left out loses the permission it had. The usual shape is to read GET /directories/{directoryId}/permissions and send its groups back with the one change applied.

An empty list is a legitimate body and revokes every permission set on this directory. Permissions inherited from the directories above are not affected by it.

groups*array<>

The groups that may reach this directory, each with its right. A group is named by its id, as returned by GET /user-groups. A group that does not exist, or that belongs to another tenant, is silently skipped: the call still answers 200, and since this body replaces the whole set, a wrong id therefore revokes rather than grants. Check the answer, which lists what is now set.

Response Body

The permissions of the directory as they are now.

application/json
  1. response

Who may reach a directory, and with which right. Galilea shares a directory with a user group, never with a single person, so this is the whole of the answer to "who sees this folder": the people in these groups, and nobody else.

groups*array<>

The permissions set on this directory itself. This is the set POST replaces, so it is what a caller reads before writing.

inheritedGroups*array<>

The permissions this directory has from the directories above it. A permission is inherited downwards and cannot be narrowed further down, so a group listed here reaches this directory whatever groups says. Each entry names the directory the right comes from.

numberOfUsersWithInheritedPermissions?integer

How many people are in the groups of inheritedGroups, counted once per person. The readable answer to how many colleagues reach this directory from above.

curl -X POST "https://example.com/directories/7d9030b3-4c0f-4051-9d54-79a6802a0c22/permissions" \  -H "Content-Type: application/json" \  -d '{    "groups": [      {        "group": {          "id": "7f3b2a10-11ef-4c2e-9a71-2b6d5c8e4419"        },        "permission": "view"      }    ]  }'
{  "groups": [    {      "group": {        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",        "type": "tenant_all",        "name": "string",        "acronym": "st",        "color": "string",        "emailAddress": "string",        "numberOfMembers": 0,        "tenant": {          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",          "name": "string"        },        "user": {},        "createdAt": "2019-08-24T14:15:22Z",        "lastModifiedAt": "2019-08-24T14:15:22Z"      },      "permission": "view"    }  ],  "inheritedGroups": [    {      "group": {        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",        "type": "tenant_all",        "name": "string",        "acronym": "st",        "color": "string",        "emailAddress": "string",        "numberOfMembers": 0,        "tenant": {          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",          "name": "string"        },        "user": {},        "createdAt": "2019-08-24T14:15:22Z",        "lastModifiedAt": "2019-08-24T14:15:22Z"      },      "permission": "view",      "directory": {        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",        "name": "string",        "parentPath": [          "7924443e-e7c3-4361-a028-25053af0dbf9"        ]      }    }  ],  "numberOfUsersWithInheritedPermissions": 42}