|
Leosac
0.8.0
Open Source Access Control
|
Go to the documentation of this file.
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);
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 std::string & lastname() const
bool is_valid() const
Check the validity status (enabled / disabled) of the user.
IAccessProfilePtr profile() const noexcept
IAccessProfilePtr profile_
UserRank rank() const
Get the global rank of the user.
std::shared_ptr< IAccessProfile > IAccessProfilePtr
size_t odb_version() const
boost::optional< ScryptResult > password_
This is the header file for a generated source file, GitSHA1.cpp.
const std::string & username() const noexcept
Get the username of this user.
std::vector< Tools::ScheduleMappingLWPtr > lazy_schedules_mapping() const
UserId id() const noexcept
void schedule_mapping_added(const Tools::ScheduleMappingPtr &sched_mapping)
The user has been mapped by a schedule.
std::string password() const
Returns the password hash + salt (as stored in the database).
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::shared_ptr< ICredential > ICredentialPtr
std::set< UserGroupMembershipPtr, UserGroupMembershipComparator > UserGroupMembershipSet
const std::string & email() const
const ValidityInfo & validity() const
std::vector< Cred::CredentialLWPtr > credentials_
std::vector< Tools::ScheduleMappingLWPtr > schedules_mapping_
ScheduleMapping object to which we are mapped directly (as user).
std::string username_
This is an (unique) identifier for the user.
std::vector< Cred::CredentialLWPtr > lazy_credentials() const
ValidityInfo validity_
A user can have the same validity than credentials.
A simple class that stores (and can be queried for) the validity of some objects.
const std::string & firstname() const
void add_credential(const Cred::ICredentialPtr &cred)
UserGroupMembershipSet membership_