Mira Get Permission Codes icon

Mira Get Permission Codes

Get permission codes for current user from Mira App Server

Mira Get Permission Codes

AI-generated

Overview

This node, named "Mira Get Permission Codes," retrieves the permission codes associated with the current user from a Mira App Server. It is useful in scenarios where you need to verify or utilize the user's permissions within workflows, such as controlling access to certain operations or customizing behavior based on user roles.

For example, you might use this node to:

  • Fetch and check user permission codes before performing sensitive actions.
  • Dynamically adjust workflow steps depending on the permissions granted to the user.
  • Audit or log user permissions for compliance or debugging purposes.

Properties

Name Meaning
Token Source Choose where to get the access token from: either from stored credentials or from input data.
Server URL The URL of the Mira App Server to connect to (required if token source is input).
Access Token The access token used for authentication, either provided directly or via input data (required if token source is input).

The Token Source property has two options:

  • From Credentials: Use the token stored in the node's configured API credentials.
  • From Input Data: Use the token provided dynamically in the input data or entered directly.

Output

The node outputs JSON data containing the permission codes retrieved from the Mira App Server under the json field. If no permission codes are available, it returns an object with a message indicating that no permission codes are present.

Example output structure:

{
  "json": {
    "codes": ["code1", "code2", "..."]
  }
}

or if none are available:

{
  "json": {
    "message": "No permission codes available"
  }
}

The node does not output binary data.

Dependencies

  • Requires access to a Mira App Server endpoint /api/auth/codes.
  • Needs an access token for authentication, which can be supplied either via credentials configured in n8n or dynamically through input data.
  • No additional external dependencies beyond standard HTTP requests.

Troubleshooting

  • Common issues:

    • Invalid or missing access token will cause authentication failures.
    • Incorrect server URL may lead to connection errors.
    • Network issues or server downtime will prevent fetching permission codes.
  • Error messages:

    • Authentication errors typically indicate invalid or expired tokens; ensure the token is correct and valid.
    • Connection errors suggest checking the server URL and network connectivity.
    • If the response contains no permission codes, verify that the user actually has assigned permissions on the Mira App Server.

Links and References

  • Mira App Server API documentation (for /api/auth/codes endpoint) — consult your Mira App Server docs for detailed API usage.
  • n8n documentation on using credentials and input data for authentication tokens.

Discussion