4.4. Create users
| Id | 4.4. |
| Description | As a Application Administrator, I must be able to create user accounts and assigning them the appropriate roles, So that I can control access to the system and ensure that each user has the correct permissions based on their responsibilities. |
| Priority | High |
| Actors | Application Administrator |
| API Calls | GET /admin/api-users POST /admin/api-users |
| Linked Processes | |
| Status | Implemented |
Preconditions
- The User must be authenticated and have the Application Administrator role.
- The system must have a list of predefined roles available for assignment.
Postconditions
- The user list is updated with the new accounts.
- Notifications are sent to affected users regarding the account creation.
- All assigned roles are correctly enforced by the system
Main flow
- he Application Administrator retrieves a list of existing users with their details and roles (GET).
- The Application Administrator uses an API to add a new user by entering required details (e.g., name, email) and assigning roles (POST).
- The system validates the input data.
- The system saves the changes and updates the user list.
Exceptions
[400 Bad Request] Invalid input:
If mandatory fields are missing or invalid, the system returns an error message.
[409 Already Exists] Duplicate User
If the Application Administrator attempts to add a user with an email already registered, the system returns an error and prevents duplicate creation.
[500 Internal Server Error] System Error
If the system fails to save changes due to an internal error, it displays an appropriate message and logs the error for further investigation.