younifyd
Menu

Update Permission

Update a Permission Rule

PATCH/permissions/{id}

Use it in a workflow

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

Request

Path parameters

idintegerrequired

Identifier for the object.

Query parameters

metastring

What metadata to return in the response.

Request body

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

collectionobject

What collection this permission applies to.

commentstring

If the user can post comments. full.

One ofnonecreateupdate

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

read_field_blacklistobject

Explicitly denies read access for specific fields.

roleobject

Unique identifier of the role this permission applies to.

statusobject

What status this permission applies to.

status_blacklistobject

Explicitly denies specific statuses to be used.

updatestring

If the user can update items.

One ofnoneminerolefull

write_field_blacklistobject

Explicitly denies write access for specific fields.

json
{
  "collection": {},
  "comment": "none",
  "create": "none",
  "delete": "none",
  "explain": "none",
  "read": "none",
  "read_field_blacklist": {},
  "role": {},
  "status": {},
  "status_blacklist": {},
  "update": "none",
  "write_field_blacklist": {}
}

Response

Returns 200 with an object. Read it in later steps with {{updatePermission.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.