Actions100
- Activity Actions
- Asset Actions
- Authentication Actions
- Collection Actions
- Extension Actions
- Field Actions
- File Actions
- Folder Actions
- Item Actions
- Permission Actions
- Preset Actions
- Relation Actions
- Revisions Actions
- Roles Actions
- Settings Actions
- Users Actions
- Utilities Actions
Overview
The Permission: Update Multiple operation in this n8n node allows you to update multiple permission records at once in a Directus instance. This is particularly useful for bulk editing permissions, such as changing access rights or roles for several users or groups simultaneously. For example, if you need to update the allowed actions or fields for a set of permissions across different collections, this operation streamlines the process by letting you specify all changes in a single request.
Practical scenarios:
- Granting or revoking access to multiple resources for a group of users.
- Updating permission rules after a policy change.
- Bulk-editing which fields are accessible for certain roles.
Properties
Name | Type | Meaning |
---|---|---|
Data (JSON) | json | A JSON object containing: - keys : An array of primary keys (IDs) of the permissions you want to update.- data : An object with the properties and values to update for each permission.See Directus Permission Object for available properties. |
Output
- The output will be an array of objects under the
json
field. - Each object represents the updated permission(s) as returned by the Directus API.
- The structure of each object matches the Directus Permission Object, typically including fields like
id
,role
,collection
,action
,fields
,permissions
, etc.
Example output:
[
{
"json": {
"id": 34,
"role": "admin",
"collection": "articles",
"action": "read",
"fields": ["id", "title", "body"],
// ...other permission properties
}
},
{
"json": {
"id": 65,
"role": "editor",
"collection": "comments",
"action": "update",
"fields": ["id", "content"],
// ...other permission properties
}
}
]
Dependencies
- Directus API: Requires access to a running Directus instance.
- API Credentials: You must configure the
directusApi
credentials in n8n for authentication.
Troubleshooting
Common issues:
- Invalid JSON: If the
Data (JSON)
property is not valid JSON, the node will throw a parsing error. Double-check your input format. - Missing Keys/Data: Both
keys
anddata
must be provided. Omitting either will result in an error from the Directus API. - Permission Denied: If the API credentials do not have sufficient rights to update the specified permissions, the operation will fail.
- Nonexistent IDs: If any of the provided keys do not correspond to existing permissions, those updates will fail.
Error messages and resolutions:
"Unexpected token ... in JSON"
: Check that your JSON input is correctly formatted."Cannot read property 'data' of undefined"
: Likely due to an unexpected response from the API; check your Directus instance and network connectivity."You do not have permission to perform this action"
: Ensure your API user has the necessary privileges.