Role Management

Define and manage roles within Hyper to control access to data and API functions.

Role Management within Hyper is crucial for establishing a secure and efficient access control system. It allows developers to define distinct roles with specific permissions, which can then be assigned to users within the system. This granularity in access control helps to ensure that users have the appropriate level of access to the vectorized data used in RAG queries.

Creating Roles

To create a role in Hyper, follow these steps:

  1. Define Role: Decide on the name and permissions associated with the role.
  2. API Request: Send a POST request to the role management endpoint with the role definition.
  3. Handle API Response: On successful creation, the API will return details of the new role.
POST /api/roles
  "name": "role_name",
  "permissions": ["permission1", "permission2", ...]

Updating Roles

Roles may need to be updated to adjust their permissions as your application evolves:

  • Specify Role ID: Use the role's unique ID to identify it in the system.
  • Send Update Request: Make a PUT request with updated role information.
  • Apply Changes: The API will confirm the changes have been applied.
PUT /api/roles/{roleId}
  "name": "updated_role_name",
  "permissions": ["updated_permission1", "updated_permission2", ...]

Deleting Roles

To remove a role that is no longer needed:

  • Identify Role: Use the role's ID to specify which role to delete.
  • API Deletion Call: Send a DELETE request to the role management endpoint.
  • Confirmation: The API will provide a success response upon deletion.
DELETE /api/roles/{roleId}

Assigning Roles to Users

With defined roles, you can assign them to users:

  • Identify User: Specify the user by their ID or other unique identifier.
  • Role Assignment: Update the user's details to include the role using a PUT request.
  • Verify Assignment: Ensure the user's role has been updated correctly in the system.
PUT /api/users/{userId}
  "role": "roleId"

Managing Role-Based Permissions

Permissions tied to roles dictate what actions users can perform:

  • Review Role Permissions: Check the permissions currently assigned to a role.
  • Modify Permissions: Adjust the role's permissions as needed for your application's security requirements.
  • Update Role: Apply the updated permissions to the role.

Best Practices

  • Regular Role Audits: Conduct frequent audits of roles and permissions to maintain a secure access control system.
  • Clear Role Definitions: Ensure roles are well-defined and understood within your organization to prevent access issues.
  • Secure Management: Use secure methods for managing roles, including API keys and HTTPS connections.

Role Management is a foundational component of the Hyper platform's access control capabilities, enabling you to safeguard your application's data and API functionality by ensuring users can only access what they need to perform their tasks.

For more details and examples of role management API calls, refer to the Hyper API Reference documentation.