Directus (DrWade) icon

Directus (DrWade)

Consume Directus API

Overview

The Directus (DrWade) n8n node for the resource Permissions with the operation Get allows you to retrieve detailed information about a specific permission rule from your Directus instance by its unique ID. This is useful in scenarios where you need to programmatically inspect or audit access control rules, automate permission checks, or integrate permission data into other workflows.

Practical examples:

  • Fetching details of a permission rule to display or log them.
  • Validating that a certain permission exists before performing an action.
  • Auditing permission configurations as part of compliance workflows.

Properties

Name Type Meaning
ID String Primary key of the permission rule. Used to specify which rule to fetch.

Output

  • The output will be a single object in the json field containing all properties of the requested permission rule as returned by the Directus API.
  • If the permission rule does not exist or an error occurs, and "Continue On Fail" is enabled, the output will contain an error property with the error message.

Example output:

{
  "id": 34,
  "role": "admin",
  "collection": "articles",
  "action": "read",
  "permissions": { /* ... */ },
  // ...other fields as provided by Directus
}

Dependencies

  • Directus API: You must have a running Directus instance accessible from n8n.
  • API Credentials: Requires a configured Directus API credential (directusApi) in n8n with sufficient permissions to read permission rules.

Troubleshooting

  • Invalid ID: If the provided ID does not correspond to any permission rule, you may receive an error such as "Not Found" or similar.
    • Resolution: Double-check the ID value.
  • Authentication/Authorization Errors: If the credentials are missing or lack sufficient rights, errors like "Unauthorized" or "Forbidden" may occur.
    • Resolution: Ensure the API credentials are correct and have the necessary permissions.
  • Network Issues: Connection problems to the Directus server will result in network-related errors.
    • Resolution: Verify network connectivity and Directus server status.

Links and References

Discussion