30 #include <boost/optional.hpp> 41 #pragma db object optimistic 42 class User :
public std::enable_shared_from_this<User>
60 virtual ~User() =
default;
65 const std::string &
username()
const noexcept;
73 void password(
const std::string &pw);
99 void username(
const std::string &username);
106 const std::string &
lastname()
const;
107 const std::string &
email()
const;
112 void email(
const std::string &);
162 #pragma db type("VARCHAR(128)") 165 #pragma db type("TEXT") 172 #pragma db value_not_null inverse(user_) 178 #pragma db value_not_null inverse(owner_) 184 #pragma db value_not_null inverse(users_) 199 friend class ::Leosac::TestAccess;
const UserGroupMembershipSet & group_memberships() const
Retrieve the UserGroupMembership that this user is involved with.
bool verify_password(const std::string &pw) const
Verify that the password pw is equal to the user's password.
std::string username_
This is an (unique) identifier for the user.
This is the header file for a generated source file, GitSHA1.cpp.
std::string password() const
Returns the password hash + salt (as stored in the database).
void add_credential(const Cred::ICredentialPtr &cred)
A simple class that stores (and can be queried for) the validity of some objects. ...
boost::optional< ScryptResult > password_
const std::string & email() const
ValidityInfo validity_
A user can have the same validity than credentials.
std::shared_ptr< ICredential > ICredentialPtr
std::shared_ptr< IAccessProfile > IAccessProfilePtr
IAccessProfilePtr profile() const noexcept
std::vector< Cred::CredentialLWPtr > credentials_
std::vector< Cred::CredentialLWPtr > lazy_credentials() const
UserGroupMembershipSet membership_
std::set< UserGroupMembershipPtr, UserGroupMembershipComparator > UserGroupMembershipSet
std::vector< Tools::ScheduleMappingLWPtr > schedules_mapping_
ScheduleMapping object to which we are mapped directly (as user).
bool is_valid() const
Check the validity status (enabled / disabled) of the user.
std::vector< Tools::ScheduleMappingLWPtr > lazy_schedules_mapping() const
const std::string & lastname() const
IAccessProfilePtr profile_
const std::string & firstname() const
UserId id() const noexcept
const std::string & username() const noexcept
Get the username of this user.
size_t odb_version() const
const ValidityInfo & validity() const
void schedule_mapping_added(const Tools::ScheduleMappingPtr &sched_mapping)
The user has been mapped by a schedule.
UserRank rank() const
Get the global rank of the user.