younifyd
Menu

Update Access Rules

Update Multiple Access Rules

PATCH/access

Use it in a workflow

  1. Add a step and choose the Directus connector.
  2. Pick the Update Access Rules action (under Access).
  3. Fill in the fields below, then reference the result from later steps as {{updateAccessRules.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.

keysarray<string>required
dataobjectrequired
rolestring (uuid)

The role this access rule applies to.

userstring (uuid)

The user this access rule applies to.

policystring (uuid)

The policy associated with this access rule.

sortinteger

Sort order of this access rule.

json
{
  "keys": [
    "string"
  ],
  "data": {
    "role": "00000000-0000-0000-0000-000000000000",
    "user": "00000000-0000-0000-0000-000000000000",
    "policy": "00000000-0000-0000-0000-000000000000",
    "sort": 0
  }
}

Response

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

dataarray<object>
idstring (uuid)

Primary key of the access rule.

rolestring

The role this access rule applies to. Nullable if the rule applies directly to a user. Many-to-one to roles.

userstring

The user this access rule applies to. Nullable if the rule applies to a role. Many-to-one to users.

policyoneOf

The policy associated with this access rule. Many-to-one to policies.

sortinteger

Sort order of this access rule.

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": "8cbb43fe-4cdf-4991-8352-c461779cec02",
      "role": "8b4474c0-288d-4bb8-b62e-8330646bb6aa",
      "user": "0bc7b36a-9ba9-4ce0-83f0-0a526f354e07",
      "policy": "22640672-eef0-4ee9-ab04-591f3afb2886",
      "sort": 1
    }
  ],
  "meta": {
    "total_count": 0,
    "filter_count": 0
  }
}

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