|
ORE Studio 0.0.4
|
Centralized service for complete account initialization. More...
#include <account_setup_service.hpp>

Public Member Functions | |
| account_setup_service (account_service &account_svc, std::shared_ptr< authorization_service > auth_svc) | |
| Constructs an account_setup_service with required dependencies. | |
| domain::account | create_account (const std::string &username, const std::string &email, const std::string &password, const std::string &recorded_by, const std::string &change_commentary="Account created") |
| Creates a new account with the default Viewer role. | |
| domain::account | create_account_with_role (const std::string &username, const std::string &email, const std::string &password, const std::string &recorded_by, const std::string &role_name, const std::string &change_commentary="Account created") |
| Creates a new account with a specific role. | |
Centralized service for complete account initialization.
This service orchestrates the full account creation workflow:
Use this service instead of calling account_service::create_account() directly to ensure accounts are properly initialized with roles.
| account_setup_service | ( | account_service & | account_svc, |
| std::shared_ptr< authorization_service > | auth_svc | ||
| ) |
Constructs an account_setup_service with required dependencies.
| account_service | The service for account creation |
| auth_service | The service for role assignment |
| domain::account create_account | ( | const std::string & | username, |
| const std::string & | email, | ||
| const std::string & | password, | ||
| const std::string & | recorded_by, | ||
| const std::string & | change_commentary = "Account created" |
||
| ) |
Creates a new account with the default Viewer role.
This method:
| username | The unique username for the account |
| The email address for the account | |
| password | The plaintext password (will be hashed) |
| recorded_by | The username of the person creating the account |
| change_commentary | Optional commentary explaining account creation |
| std::runtime_error | If Viewer role is not found (RBAC not seeded) |
| domain::account create_account_with_role | ( | const std::string & | username, |
| const std::string & | email, | ||
| const std::string & | password, | ||
| const std::string & | recorded_by, | ||
| const std::string & | role_name, | ||
| const std::string & | change_commentary = "Account created" |
||
| ) |
Creates a new account with a specific role.
This method:
| username | The unique username for the account |
| The email address for the account | |
| password | The plaintext password (will be hashed) |
| recorded_by | The username of the person creating the account |
| role_name | The name of the role to assign |
| change_commentary | Optional commentary explaining account creation |
| std::runtime_error | If the specified role is not found |
