h2oGPTe icon

h2oGPTe

h2oGPTe is an AI-powered search assistant for your internal teams to answer questions gleaned from large volumes of documents, websites and workplace content.

Actions198

Overview

The "Permission - Resets User Roles" operation allows you to replace all roles assigned to a specific user with a new set of roles. This is useful in scenarios where you need to update or correct the roles of a user in bulk, ensuring that the user has exactly the roles specified and no others.

Practical examples:

  • When onboarding a new employee, you can assign them a predefined set of roles by resetting their roles.
  • If a user's responsibilities change, you can quickly update their access permissions by resetting their roles to match their new duties.
  • In case of security audits, you might want to revoke all existing roles and assign only the necessary ones to comply with policies.

Properties

Name Meaning
User ID The unique identifier of the user whose roles will be reset.
New Roles A string representing the new set of roles to assign to the user, replacing all current roles.

Output

The node outputs the full response from the API call that resets the user roles. The json output field contains the server's response confirming the success or failure of the operation. There is no binary data output for this operation.

Dependencies

  • Requires an API key credential configured in n8n to authenticate requests to the external service.
  • The base URL for the API is derived from the credential's URL configuration.
  • The node sends a DELETE HTTP request to the endpoint /users/{user_id}/roles with the new roles provided in the request body.

Troubleshooting

  • Common issues:

    • Invalid or missing User ID: Ensure the User ID is correctly provided and corresponds to an existing user.
    • Incorrect format of New Roles: The roles string must be formatted as expected by the API (usually comma-separated or JSON array depending on API spec).
    • Authentication errors: Verify that the API key credential is valid and has sufficient permissions.
    • Network or connectivity issues: Check network access to the API endpoint.
  • Error messages:

    • Unauthorized or 401 error: Indicates invalid or missing API credentials.
    • 404 Not Found: The specified User ID does not exist.
    • 400 Bad Request: The new roles parameter is malformed or invalid.
  • Resolution:

    • Double-check input parameters.
    • Confirm API credentials and permissions.
    • Review API documentation for correct roles formatting.

Links and References

  • Refer to the external API documentation for user role management and the exact format required for the "new_roles" parameter.
  • Consult your system administrator for API key setup and permission scopes.

Discussion