Represent a user.
More...
#include <User.hpp>
Represent a user.
Definition at line 42 of file User.hpp.
◆ User() [1/3]
User::User |
( |
const std::string & |
username | ) |
|
◆ User() [2/3]
◆ User() [3/3]
User::User |
( |
const UserId & |
id | ) |
|
Create a user with a predefined UserId.
- Parameters
-
Definition at line 48 of file User.cpp.
◆ ~User()
virtual Leosac::Auth::User::~User |
( |
| ) |
|
|
virtualdefault |
◆ add_credential()
◆ email() [1/2]
const std::string & User::email |
( |
| ) |
const |
◆ email() [2/2]
void User::email |
( |
const std::string & |
e | ) |
|
◆ firstname() [1/2]
const std::string & User::firstname |
( |
| ) |
const |
◆ firstname() [2/2]
void User::firstname |
( |
const std::string & |
f | ) |
|
◆ group_memberships()
Retrieve the UserGroupMembership that this user is involved with.
While the set is always eagerly loaded, the group()
and user()
method in each Membership will return lazy weak pointer.
Definition at line 133 of file User.cpp.
◆ id()
unsigned long User::id |
( |
| ) |
const |
|
noexcept |
◆ is_valid()
bool User::is_valid |
( |
| ) |
const |
Check the validity status (enabled / disabled) of the user.
Definition at line 123 of file User.cpp.
◆ lastname() [1/2]
const std::string & User::lastname |
( |
| ) |
const |
◆ lastname() [2/2]
void User::lastname |
( |
const std::string & |
l | ) |
|
◆ lazy_credentials()
◆ lazy_schedules_mapping()
◆ odb_version()
size_t User::odb_version |
( |
| ) |
const |
◆ password() [1/2]
std::string User::password |
( |
| ) |
const |
Returns the password hash + salt (as stored in the database).
The use of this function should be rather sparse.
Definition at line 154 of file User.cpp.
◆ password() [2/2]
void User::password |
( |
const std::string & |
pw | ) |
|
Set a new password for the user.
- Parameters
-
<tt>pw</tt> | A cleartext representation of the password. |
Definition at line 138 of file User.cpp.
◆ profile() [1/2]
◆ profile() [2/2]
◆ rank() [1/2]
Get the global rank of the user.
Definition at line 161 of file User.cpp.
◆ rank() [2/2]
Set the global rank of the user.
Definition at line 166 of file User.cpp.
◆ schedule_mapping_added()
◆ username() [1/2]
const std::string & User::username |
( |
| ) |
const |
|
noexcept |
Get the username of this user.
Definition at line 55 of file User.cpp.
◆ username() [2/2]
void User::username |
( |
const std::string & |
username | ) |
|
Set a new username.
A few rules regarding usernames:
- Username are always case insensitive, and are store in lower case.
- Only alphanumeric ASCII characters, "_", "." and "-" are allowed.
- Note
- This function will throw if the username is invalid.
Definition at line 62 of file User.cpp.
◆ validity() [1/2]
◆ validity() [2/2]
◆ verify_password()
bool User::verify_password |
( |
const std::string & |
pw | ) |
const |
Verify that the password pw
is equal to the user's password.
- Parameters
-
pw | A cleartext string representing the password you want to check. |
- Returns
- True is
pw
is the correct password, false otherwise.
Definition at line 144 of file User.cpp.
◆ ::Leosac::TestAccess
◆ odb::access
◆ credentials_
◆ email_
std::string Leosac::Auth::User::email_ |
|
protected |
◆ firstname_
std::string Leosac::Auth::User::firstname_ |
|
protected |
◆ id_
UserId Leosac::Auth::User::id_ |
|
protected |
◆ lastname_
std::string Leosac::Auth::User::lastname_ |
|
protected |
◆ membership_
◆ password_
◆ profile_
◆ rank_
◆ schedules_mapping_
ScheduleMapping object to which we are mapped directly (as user).
Definition at line 185 of file User.hpp.
◆ username_
std::string Leosac::Auth::User::username_ |
|
protected |
This is an (unique) identifier for the user.
Definition at line 163 of file User.hpp.
◆ validity_
A user can have the same validity than credentials.
Definition at line 190 of file User.hpp.
◆ version_
const size_t Leosac::Auth::User::version_ |
|
protected |
The documentation for this class was generated from the following files: