Version #
Version 1
Module Type #
Standard
Internal Name #
adminRights
Status #
Draft
Description #
The Admin Rights Module manages the permissions assigned to admin roles. In Version 1, all admins receive full rights by default. This only Right can be hardcoded; no endpoints will exist for CRUD operations. The Module have basic error handling.
User Journeys #
getAdminRight #
Name
getAdminRight
Overview
This user journey describes how an authenticated admin retrieves their assigned admin rights (permissions) from the system. By making a request to the /adminRights/get endpoint, the admin can view any rights configuration currently applicable to their role.
Actors
- Admin User (initiator)
- Admin Rights Module (system)
- Auth Module (handles Authentication)
Preconditions
- The admin must be authenticated via the Auth Module (valid JWT Token).
- The Admin Rights Module must be operational and accessible.
Flow
Primary Flow
- The Admin User sends a POST request to /adminRights/get, including their valid JWT.
- The Admin Rights Module validates the request and looks up the admin”s role-based permissions.
- The module returns a success response, such as: { “RoleID”: “role-admin-001”, “Permissions”: { “all”: “full-access” }}
- A webhook (adminRightsRetrieved) is triggered to log or handle the successful retrieval of rights.
Alternative/Exception Flows
- If an error occurs (e.g., invalid Token, missing role data), the system returns: { “status”: “Error” } and triggers the adminRightsError webhook with details about the error.
Outcome
- The admin”s role-based permissions are successfully retrieved, allowing the admin to know what actions they can perform within the system.
Error Handling
- On error, the module responds with { “status”: “Error” }.
- The adminRightsError webhook is fired, including error context (timestamp, endpoint, etc.).
Postconditions
- On success, the admin now has an accurate view of their rights configuration.
- On error, no rights data is returned, and the error is logged for further investigation.
Triggers
- adminRightsRetrieved: Fired when the admin”s rights are successfully returned.
- adminRightsError: Fired when an error occurs while retrieving rights.
Notes
- In Version 1, all admins have full access rights by default.
- No endpoints exist to create or modify admin rights in Version 1; everything is hardcoded.
Authentication #
Authentication for is managed via the Auth Module. Module-to-module communication in Version 1 does not require Authentication. Internal services can call the Admins Module freely.
Schema #
AdminRights #
Name | Type | Internal Name | Description |
admin_right_id | UUID/String | adminRights.AdminRights.admin_right_id | Unique identifier for the rights configuration |
admin_role_id | String | adminRights.AdminRights.admin_role_id | Associated admin role (Standard) |
admin_right_permissions | JSON | adminRights.AdminRights.admin_right_permissions | Full access rights in Version 1 |
Functions #
Name | Endpoint | Description | Internal Name | Input | Response |
getAdminRight | /adminRights/get | Retrieves rights for the admin role | adminRights.getAdminRight | { “admin_role_id”: “role-admin-001” } | { “admin_role_id”: “role-admin-001”, “admin_right_permissions”: { “all”: “full-access” } }or{ “status”: “Error” } |
Webhooks #
Name | Trigger | Destination | Payload | Description | Error Handling |
adminRightsRetrieved | When an admin retrieves their assigned rights. | Log Module | json { “event”: “admin.rights_retrieved”, “timestamp”: “2025-03-13T12:00:00Z”, “admin”: { “AdminID”: “admin-001”, “Permissions”: { “read”: true, “write”: true, “delete”: true } } } | Sends a webhook to the Log Module when an admin fetches their assigned rights. | None |
adminRightsError | Triggered when an error occurs during any Admin Rights module operation (e.g., while retrieving rights). | Log Module | { “event”: “adminRightsError”, “timestamp”: “2025-03-13T12:00:00Z”, “error”: “Error message details”, “endpoint”: “/adminRights/get”} | Sends a webhook to the Log Module containing details of the error, including the endpoint where it occurred, a timestamp, and an error message. | None |
Settings #
Not applicable
Clarifications #
- The Standard admin role is assumed to have full permissions (read, write, create, delete) on every resource in the system. In version 1 all admins have the Admin Role Standard, so all Admins have all rights.
- This configuration is fixed in Version 1 for simplicity.
- Future versions may introduce more granular rights or multiple admin roles with differing permissions.