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 interacts with the Directus API to manage permissions. Specifically, the "Permissions" resource with the "List" operation retrieves a list of permission objects from a Directus instance. It supports fetching all permissions or limiting the number of results, applying filters, sorting, grouping, and exporting the data in various formats.
Common scenarios where this node is beneficial include:
- Auditing or reviewing user permissions within a Directus-managed project.
- Automating reports on permission settings for compliance or security reviews.
- Integrating permission data into workflows that require conditional logic based on access rights.
Practical example:
- A workflow that periodically fetches all permissions and exports them as a CSV file for offline analysis.
- Fetching a limited set of permissions filtered by certain criteria (e.g., specific roles or collections) to trigger alerts if unexpected permissions are found.
Properties
| Name | Meaning |
|---|---|
| Return All | Boolean flag to return all permission records or limit the number of returned items. |
| Limit | Number specifying the maximum number of permission objects to return when "Return All" is false. Range: 1 to 100. |
| Split Into Items | Boolean indicating whether to output each element of the returned array as an individual item or as a single array. |
| JSON/RAW Parameters | Boolean to choose between setting query parameters via UI fields or providing raw JSON input. |
| Query Parameters | JSON object representing query parameters for filtering, sorting, pagination, etc., used when "JSON/RAW Parameters" is true. |
| Additional Fields | Collection of optional fields to customize the request, including: |
| - Aggregate | Aggregation functions like count, sum, average, min, max applied on specified fields. |
| - Binary Property for Export Data | Name of the binary property to store exported data. |
| - Deep (JSON) | JSON object to specify nested relational dataset query parameters. |
| - Export | Option to export the API response as a file in one of these formats: CSV, JSON, XML. |
| - Fields | String to control which fields are returned in the response objects. |
| - File Name for Export Data | Filename (without extension) for the exported file. |
| - Filter (JSON) | JSON object defining conditions to filter the collection items. |
| - Group By | String specifying fields to group results by, enabling aggregation per group. |
| - Meta | String specifying metadata to include in the response. |
| - Offset | Number of items to skip before starting to collect the result set. |
| - Search | String to filter items containing the search query in any field. |
| - Sort | CSV string defining sort order of returned items; prefix with "-" for descending, "?" for random order. |
Output
The node outputs JSON data representing the permission objects retrieved from the Directus API. The structure corresponds directly to the API's permission resource schema, typically including fields such as permission ID, collection, action, role, and other relevant permission details.
If the "Export" option is selected, the node outputs the API response as a binary file in the chosen format (CSV, JSON, or XML). The binary data is stored under the specified binary property name (default "data"), allowing downstream nodes to handle the exported file accordingly.
When "Split Into Items" is enabled, each permission object is output as a separate item; otherwise, the entire array is output as a single item.
Dependencies
- Requires a valid connection to a Directus instance via an API key credential configured in n8n.
- The node uses the Directus REST API endpoints for permissions.
- No additional external dependencies beyond the Directus API and n8n environment.
Troubleshooting
- Authentication errors: Ensure the API key credential is correctly configured and has sufficient permissions to access the permissions endpoint.
- Invalid JSON in parameters: When using JSON/RAW parameters, ensure the JSON syntax is correct to avoid parsing errors.
- Limit exceeded: The "Limit" property accepts values between 1 and 100; exceeding this range may cause errors.
- Empty results: Verify that filters, search queries, or other parameters are correctly set and match existing permissions.
- Export issues: If exporting data, confirm that the binary property name and file name are valid strings and that downstream nodes can handle the binary data.