younifyd
Menu

Update Permissions

Update Multiple Permission Rules

PATCH/permissions

Use it in a workflow

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

Request

Query parameters

fieldsarray<string>

Control what fields are being returned in the object.

limitinteger

A limit on the number of objects that are returned.

metastring

What metadata to return in the response.

offsetinteger

How many items to skip when fetching data.

sortarray<string>

How to sort the returned items. `sort` is a CSV of fields used to sort the fetched items. Sorting defaults to ascending (ASC) order but a minus sign (` - `) can be used to reverse this to descending (DESC) order. Fields are prioritized by their order in the CSV.

filterany

Select items in collection by given conditions.

searchstring

Filter by items that contain the given search query in one of their fields.

Request body

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

dataobjectrequired
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.

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

Response

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

dataarray<object>
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.

metaobject
total_countinteger

Returns the total item count of the collection you're querying.

filter_countinteger

Returns the item count of the collection you're querying, taking the current filter/search parameters into account.

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

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