younifyd
Menu

Create Permission

Create a Permission Rule

POST/permissions‎

Use it in a workflow

  1. Add a step and choose the Directus connector.
  2. Pick the Create Permission action (under Permissions).
  3. Fill in the fields below, then reference the result from later steps as {{createPermission.response.data}}.

Request

Query parameters

metastring

What metadata to return in the response.

Request body

Enter the body as JSON in the step's Body field.

collectionstring

What collection this permission applies to.

commentstring

If the user can post comments.

One ofnonecreateupdatefull

createstring

If the user can create items.

One ofnonefull

deletestring

If the user can update items.

One ofnoneminerolefull

explainstring

If the user is required to leave a comment explaining what was changed.

One ofnonecreateupdatealways

readstring

If the user can read items.

One ofnoneminerolefull

roleinteger

Unique identifier of the role this permission applies to.

read_field_blacklistarray<string>

Explicitly denies read access for specific fields.

statusstring

What status this permission applies to.

status_blacklistarray<string>

Explicitly denies specific statuses to be used.

updatestring

If the user can update items.

One ofnoneminerolefull

write_field_blacklistarray<string>

Explicitly denies write access for specific fields.

json
{
  "collection": "customers",
  "comment": "none",
  "create": "none",
  "delete": "none",
  "explain": "none",
  "read": "none",
  "role": 3,
  "read_field_blacklist": [
    "featured_image"
  ],
  "status": "string",
  "status_blacklist": [
    "string"
  ],
  "update": "none",
  "write_field_blacklist": [
    "string"
  ]
}

Response

Returns 200 with an object. Read it in later steps with {{createPermission.response.data.<field>}}.

dataobject
idinteger

Unique identifier for the permission.

collectionstring

What collection this permission applies to.

actionstring

What action this permission applies to.

One ofcreatereadupdatedelete

permissionsobject

JSON structure containing the permissions checks for this permission.

validationobject

JSON structure containing the validation checks for this permission.

presetsobject

JSON structure containing the preset value for created/updated items.

fieldsarray<string>

CSV of fields that the user is allowed to interact with.

policystring (uuid)

Policy this permission applies to. Many-to-one to policies.

json
{
  "data": {
    "id": 1,
    "collection": "customers",
    "action": "create",
    "permissions": {},
    "validation": {},
    "presets": {},
    "fields": [
      "string"
    ],
    "policy": "00000000-0000-0000-0000-000000000000"
  }
}

Need more? See the Directus guide for connection setup and behaviour shared by every action.

Create Permission — Directus — Documentation