Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
UserProfileManager.hpp
Go to the documentation of this file.
1#ifndef IV_SRC_CONFIG_USERPROFILEMANAGER_HPP_
2#define IV_SRC_CONFIG_USERPROFILEMANAGER_HPP_
3
5
6#include <memory>
7
8namespace iv::config
9{
10
12{
13public:
14 static std::string generateRandomPassword();
15
17 explicit UserProfileManager(const std::weak_ptr<iv::diamar::UserProfile> &defaultUser,
18 const std::weak_ptr<iv::diamar::UserProfile> &defaultWithAccess);
19 UserProfileManager(const UserProfileManager &other) = delete;
22
25
26 void configure(const std::weak_ptr<iv::diamar::UserProfile> &defaultUser,
27 std::weak_ptr<iv::diamar::UserProfile> defaultUserWithAccess);
28
29 [[nodiscard]] const iv::core::MonotonicTimer &timerAccess() const;
30
31 void processTimer();
32 void restartTimer();
33
35
36 void setDefaultProfile(const std::weak_ptr<iv::diamar::UserProfile> &userProfile);
37 void setProfile(const std::weak_ptr<iv::diamar::UserProfile> &userProfile);
38 void setChangedToDefault(bool value);
39
40 [[nodiscard]] bool hasPermissionToChangeNetworks() const;
41 [[nodiscard]] bool hasPermissionToChangeSecuritySettings() const;
42 [[nodiscard]] bool hasPermissionToCreateBackup() const;
43 [[nodiscard]] bool hasPermissionToRecoverBackup() const;
44
45 [[nodiscard]] bool hasPermissionToACK() const;
46 [[nodiscard]] bool hasPermissionToChangeParameters() const;
47 [[nodiscard]] bool hasPermissionToControlAccess() const;
48 [[nodiscard]] bool isChangedToDefault() const;
49 [[nodiscard]] bool mustBeNotified() const;
50 [[nodiscard]] bool mustBeNotifiedByRepeatersZone() const;
51
52 [[nodiscard]] std::weak_ptr<iv::diamar::UserProfile> getUserProfile() const;
53 [[nodiscard]] std::weak_ptr<iv::diamar::UserProfile> getUserProfileActive() const;
54 [[nodiscard]] std::weak_ptr<iv::diamar::UserProfile> getUserProfileDefault() const;
55 [[nodiscard]] std::weak_ptr<iv::diamar::UserProfile> getUserProfileDefaultWithAccess() const;
56
57private:
58 std::weak_ptr<iv::diamar::UserProfile> m_active;
59 std::weak_ptr<iv::diamar::UserProfile> m_default;
60 std::weak_ptr<iv::diamar::UserProfile> m_normalDefault;
61 //TODO: Check if this is still useful
62 std::weak_ptr<iv::diamar::UserProfile> m_defaultWithAccess;
63
65 bool m_inPerpetualMode = false;
67};
68
69}// namespace iv::config
70
71#endif//IV_SRC_CONFIG_USERPROFILEMANAGER_HPP_
Definition UserProfileManager.hpp:12
bool mustBeNotifiedByRepeatersZone() const
Definition UserProfileManager.cpp:341
void restartTimer()
Definition UserProfileManager.cpp:76
bool isChangedToDefault() const
Definition UserProfileManager.cpp:313
bool hasPermissionToChangeSecuritySettings() const
Definition UserProfileManager.cpp:162
void setChangedToDefault(bool value)
Definition UserProfileManager.cpp:131
std::weak_ptr< iv::diamar::UserProfile > m_defaultWithAccess
Definition UserProfileManager.hpp:62
std::weak_ptr< iv::diamar::UserProfile > m_default
Definition UserProfileManager.hpp:59
static std::string generateRandomPassword()
Definition UserProfileManager.cpp:15
bool m_isChangedToDefault
Definition UserProfileManager.hpp:64
bool mustBeNotified() const
Definition UserProfileManager.cpp:318
std::weak_ptr< iv::diamar::UserProfile > getUserProfileActive() const
Definition UserProfileManager.cpp:369
bool hasPermissionToCreateBackup() const
Definition UserProfileManager.cpp:188
UserProfileManager & operator=(UserProfileManager &&other)=delete
std::weak_ptr< iv::diamar::UserProfile > getUserProfileDefault() const
Definition UserProfileManager.cpp:374
void setDefaultProfile(const std::weak_ptr< iv::diamar::UserProfile > &userProfile)
Definition UserProfileManager.cpp:86
std::weak_ptr< iv::diamar::UserProfile > m_normalDefault
Definition UserProfileManager.hpp:60
bool m_inPerpetualMode
Definition UserProfileManager.hpp:65
bool hasPermissionToControlAccess() const
Definition UserProfileManager.cpp:287
const iv::core::MonotonicTimer & timerAccess() const
Definition UserProfileManager.cpp:51
UserProfileManager()
Definition UserProfileManager.cpp:26
void processTimer()
Definition UserProfileManager.cpp:56
iv::core::MonotonicTimer m_timerAccess
Definition UserProfileManager.hpp:66
std::weak_ptr< iv::diamar::UserProfile > m_active
Definition UserProfileManager.hpp:58
iv::diamar::eUserProfileType getTypeCurrentUser() const
Definition UserProfileManager.cpp:81
std::weak_ptr< iv::diamar::UserProfile > getUserProfile() const
Definition UserProfileManager.cpp:364
void configure(const std::weak_ptr< iv::diamar::UserProfile > &defaultUser, std::weak_ptr< iv::diamar::UserProfile > defaultUserWithAccess)
Definition UserProfileManager.cpp:38
void setProfile(const std::weak_ptr< iv::diamar::UserProfile > &userProfile)
Definition UserProfileManager.cpp:93
UserProfileManager(const UserProfileManager &other)=delete
bool hasPermissionToRecoverBackup() const
Definition UserProfileManager.cpp:214
std::weak_ptr< iv::diamar::UserProfile > getUserProfileDefaultWithAccess() const
Definition UserProfileManager.cpp:379
UserProfileManager & operator=(const UserProfileManager &other)=delete
bool hasPermissionToChangeNetworks() const
Definition UserProfileManager.cpp:136
UserProfileManager(UserProfileManager &&other)=delete
bool hasPermissionToACK() const
Definition UserProfileManager.cpp:239
bool hasPermissionToChangeParameters() const
Definition UserProfileManager.cpp:262
Definition MonotonicTimer.hpp:12
Definition ConfigSsh.hpp:13
eUserProfileType
Definition enums.hpp:34