Actions109
- Activity Actions
- Assets Actions
- Authentication Actions
- Collections Actions
- Extensions Actions
- Fields Actions
- Files Actions
- Folders Actions
- Items Actions
- Permissions Actions
- Presets Actions
- Relations Actions
- Revisions Actions
- Roles Actions
- Settings Actions
- Users Actions
- Utilities Actions
- Webhooks Actions
Overview
This node integrates with the Directus API to manage permissions within a Directus project. Specifically, the "Permissions" resource with the "Update" operation allows users to modify existing permission rules by specifying the rule's ID and providing partial permission data in JSON format.
Use cases include:
- Updating access control rules dynamically based on workflow conditions.
- Automating permission adjustments when roles or collections change.
- Integrating permission management into broader automation pipelines.
For example, you might update a permission rule to restrict access to certain fields for a specific role or adjust CRUD operations allowed on a collection.
Properties
| Name | Meaning |
|---|---|
| ID | The primary key (unique identifier) of the permission rule to update. This is required to specify which permission rule will be modified. |
| Data (JSON) | A partial JSON object representing the permission rule fields to update. This should conform to the Directus permission object structure. It allows updating any subset of the permission properties. |
Output
The node outputs the updated permission object as JSON in the json field of the output item. This object reflects the current state of the permission rule after the update operation.
No binary data output is involved in this operation.
Dependencies
- Requires an active connection to a Directus instance via an API key credential configured in n8n.
- The node uses the Directus REST API endpoint for permissions (
PATCH /permissions/{id}). - Proper permissions on the API key are necessary to perform update operations on permissions.
Troubleshooting
- Invalid ID: If the provided ID does not correspond to an existing permission rule, the API will return an error. Verify that the ID is correct.
- Malformed JSON Data: The "Data (JSON)" property must be valid JSON and conform to the expected permission object schema. Invalid JSON or incorrect fields may cause request failures.
- Insufficient API Permissions: The API key used must have rights to update permissions; otherwise, authorization errors will occur.
- Network Issues: Connectivity problems with the Directus server will result in request failures.
- Error Handling: If the node is set to continue on fail, errors will be returned in the output JSON under an
errorproperty.
To resolve errors:
- Double-check the permission rule ID.
- Validate the JSON data before input.
- Ensure the API key has adequate privileges.
- Confirm network connectivity to the Directus instance.