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
- Revision Actions
- Role Actions
- Setting Actions
- User Actions
- Utility Actions
Overview
This node is designed to update a specific permission rule within a system that manages permissions, such as an API or database with role-based access control. It allows users to modify existing permission entries by specifying the unique identifier of the permission and providing partial data to update.
Common scenarios include:
- Adjusting access rights for roles or users without recreating permissions from scratch.
- Modifying fields or conditions in permission rules dynamically based on application needs.
- Automating permission updates as part of deployment or configuration workflows.
For example, you might update a permission rule's allowed fields or change its access conditions by providing the permission ID and a JSON object describing the changes.
Properties
Name | Meaning |
---|---|
ID | The primary key (unique identifier) of the permission rule to update. This is required to specify which permission entry will be modified. |
Data (JSON) | A JSON object containing the partial permission data to update. This should follow the structure of a permission object, allowing you to specify only the fields you want to change. For instance, you can update fields like "fields", "role", or "action" depending on the permission schema. |
Output
The node outputs a JSON object representing the updated permission rule after the update operation completes successfully. This output reflects the new state of the permission, including any changes made.
If the node supports binary data output, it would typically relate to file attachments or similar, but based on the provided code and properties, this node focuses solely on JSON data related to permissions.
Dependencies
- Requires connection to a backend service or API that manages permissions (e.g., a Directus API).
- Needs appropriate authentication credentials (such as an API key or token) configured in n8n to authorize permission updates.
- The node depends on internal methods and routing logic imported from bundled dependencies, which handle the actual API calls and data processing.
Troubleshooting
- Missing or invalid ID: If the ID property is empty or incorrect, the update will fail because the node cannot identify which permission to modify. Ensure the ID corresponds to an existing permission.
- Malformed JSON in Data: Providing invalid JSON or incorrect fields in the Data property may cause errors. Validate the JSON structure against the expected permission object schema.
- Authentication errors: If the API credentials are missing or invalid, the node will not be able to perform the update. Verify that the API key or token is correctly set up.
- Permission denied: The authenticated user or token might lack sufficient rights to update permissions. Check the user's roles and permissions in the backend system.
- API endpoint issues: Network problems or API downtime can cause failures. Confirm connectivity and API availability.
Links and References
- Directus Permissions API Documentation - Reference for the permission object structure and API usage.