Skip to main content

Permission

Permissions define access rights, that a subject can have on a resource of a specific resource type.

Available permissions are always defined on resource type level. Permissions are never assigned to a subject directly but only to roles, which then can be assigned to resource members.

To give permissions, you have to define a role, which includes this permission and assign this role to the subject.

  1. Define the permissions for a resource type. (see below)
  2. Create a role, which includes permissions for this resource type
  3. Assign the role to a subject by adding the subject as a members to a resource

Common examples for permissions are:

  • read
  • write
  • delete
  • upload
  • list

Manage permissions

The Permission API is used to manage permissions for resource types.

  • /config/resource-types/<RESOURCE_TYPE_ID>/permissions
curl -i --location "https://api.spaceblocks.cloud/public/projects/<PROJECT_ID>/environments/<ENVIRONMENT_ID>/permissions/config/resource-types/<RESOURCE_TYPE_ID>/permissions" \
--request POST \
--header "Content-Type: application/json" \
--header "Authentication: Bearer <YOUR_ACCESS_TOKEN>" \
--header "apiKey: <YOUR_API_KEY>"
--data '{
"name": "<PERMISSION_NAME>",
"id": "<PERMISSION_ID>"
}'