20#ifndef ORES_VARIABILITY_SERVICE_SYSTEM_FLAGS_SERVICE_HPP
21#define ORES_VARIABILITY_SERVICE_SYSTEM_FLAGS_SERVICE_HPP
24#include "ores.logging/make_logger.hpp"
25#include "ores.database/domain/context.hpp"
26#include "ores.variability/domain/system_flags.hpp"
27#include "ores.variability/domain/system_flags_cache.hpp"
28#include "ores.variability/service/feature_flags_service.hpp"
49 inline static std::string_view logger_name =
50 "ores.variability.service.system_flags_service";
52 [[nodiscard]]
static auto& lg() {
54 static auto instance = make_logger(logger_name);
106 std::string_view recorded_by,
107 std::string_view change_reason_code,
108 std::string_view change_commentary);
130 std::string_view change_reason_code, std::string_view change_commentary);
150 std::string_view change_reason_code, std::string_view change_commentary);
170 std::string_view recorded_by,
171 std::string_view change_reason_code, std::string_view change_commentary);
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
system_flag
Enumeration of well-known system flags.
Definition system_flags.hpp:44
Service layer for the variability module.
Definition feature_flags_service.hpp:31
Context for the operations on a postgres database.
Definition context.hpp:30
POD containing cached values of well-known system flags.
Definition system_flags_cache.hpp:34
Service for managing feature flags.
Definition feature_flags_service.hpp:39
Service for accessing well-known system flags with type-safe methods.
Definition system_flags_service.hpp:47
void set_signup_requires_authorization(bool enabled, std::string_view recorded_by, std::string_view change_reason_code, std::string_view change_commentary)
Sets the signup requires authorization state.
Definition system_flags_service.cpp:118
const domain::system_flags_cache & cache() const
Gets a const reference to the cached system flags.
Definition system_flags_service.cpp:47
bool is_user_signups_enabled() const
Checks if user self-registration (signups) is enabled (from cache).
Definition system_flags_service.cpp:102
void set_bootstrap_mode(bool enabled, std::string_view recorded_by, std::string_view change_reason_code, std::string_view change_commentary)
Sets the bootstrap mode state.
Definition system_flags_service.cpp:94
void refresh()
Refreshes the cache by reading all system flags from the database.
Definition system_flags_service.cpp:30
bool is_enabled(domain::system_flag flag) const
Checks if a system flag is enabled (from cache).
Definition system_flags_service.cpp:51
void set_user_signups(bool enabled, std::string_view recorded_by, std::string_view change_reason_code, std::string_view change_commentary)
Sets the user signups state.
Definition system_flags_service.cpp:106
bool is_signup_requires_authorization_enabled() const
Checks if signup requires authorization (from cache).
Definition system_flags_service.cpp:114
bool is_bootstrap_mode_enabled() const
Checks if the system is in bootstrap mode (from cache).
Definition system_flags_service.cpp:90
void set_enabled(domain::system_flag flag, bool enabled, std::string_view recorded_by, std::string_view change_reason_code, std::string_view change_commentary)
Sets a system flag's enabled state.
Definition system_flags_service.cpp:66