Gives permissions on a data source of your organization. Permissions are added to the ones the principals already have; nothing is removed. To remove permissions, use PUT .../permissions or DELETE .../permissions/{permission}/members/{member}.
Required role: ORG_EDITOR, and the current user must have the OWNER permission on the data source.
The body is a list of { "principal": "...", "permissions": [ ... ] }. A permission the principal already has is ignored. A permission the principal only inherits from a project is added: it is then given explicitly too, and stays when the inherited one goes away with its project.
When it fails
Nothing is changed if any item is invalid. 400 if:
principalorpermissionsis missing or empty, orprincipalis not an email- a permission doesn't apply to the data source type, or to the kind of principal (see the tables below)
- after adding,
MODIFYwould be set withoutVIEW, orOWNERwithoutVIEWandMODIFY. Send them together (["OWNER", "MODIFY", "VIEW"]) unless the principal already has them. Inherited permissions don't count: an inheritedVIEWdoesn't allow addingMODIFYalone. - an organization principal is not yours, a trusted organization or
[email protected] principalis[email protected]
404 if a member or group is not a member or group of your organization.
Principals
A principal is the email of who gets the permissions:
| Principal | Format | Allowed permissions |
|---|---|---|
| Member | The member's email ([email protected]). Must be a member of your organization. | All |
| Group | <id>@group.jmapcloud.io. Must be a group of your organization. | All except OWNER |
| Your organization (every member) | <first 8 characters of your organization id>@org.jmapcloud.io | VIEW, EXTRACT_FEATURE, EXTRACT_RASTER, EXTRACT_ROW |
| A trusted organization | The trusted organization's email ([email protected]) | VIEW, EXTRACT_FEATURE, EXTRACT_RASTER, EXTRACT_ROW |
| All organizations | [email protected] | VIEW, EXTRACT_FEATURE, EXTRACT_RASTER, EXTRACT_ROW |
[email protected] can't be set here: anonymous access comes from a public project that uses the data source.
Permissions
| Permission | Data source types | Grants |
|---|---|---|
VIEW | All | Seeing the data source and displaying its data |
MODIFY | All | Changing the data source (requires VIEW) |
OWNER | All | Deleting the data source and managing its permissions (requires VIEW and MODIFY) |
EXTRACT_FEATURE | All except raster and tabular | Reading features |
CREATE_FEATURE, EDIT_FEATURE_GEOMETRY, EDIT_FEATURE_ATTRIBUTES, DELETE_FEATURE | All except raster, tabular and custom_view | Editing features |
EXTRACT_RASTER | raster, wmswmts | Reading raster data |
EXTRACT_ROW | tabular | Reading rows |
CREATE_ROW, EDIT_ROW, DELETE_ROW | tabular | Editing rows |
Permission names are case-insensitive.
Response
result is the complete list of permissions of the data source, one entry per principal:
principal: the email of the member, group or organization (see above), or[email protected].permissions: all the permissions of the principal, including inherited ones.inheritedPermissions: only present if some permissions are inherited. Each item gives thepermissionand where it comes from (fromResourceType,fromResourceId).
A permission is inherited from a project when a layer or table that uses the data source is added to the project: the principals of the project get VIEW and the matching extract permission on the data source. Inherited permissions are removed with the project, layer or table, not with these endpoints.
Data sources shared by another organization
Only the owning organization can change a data source's permissions. organization must be the organization of the access token: with the owner's organization id the request returns 403, and with yours it returns 404.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||