|
lintel 0.2.0
|
#include <User.h>
Public Types | |
| enum | Sex { Male , Female } |
Public Member Functions | |
| User (std::string firstName, std::string lastName, Sex sex, std::string email, std::string userName, std::string password, std::vector< Group > groups, std::chrono::sys_time< std::chrono::microseconds > createdTimestamp=std::chrono::time_point_cast< std::chrono::microseconds >(std::chrono::system_clock::now())) | |
| const std::string & | getFirstName () const |
| const std::string & | getLastName () const |
| Sex | getSex () const |
| const std::string & | getEmail () const |
| const std::string & | getUserName () const |
| const std::string & | getPassword () const |
| bool | has (const Group &group) const |
| const std::chrono::sys_time< std::chrono::microseconds > & | getCreatedTimestamp () const |
| const std::vector< Group > & | getGroups () const |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const User &user) |
User class for controlling of access right etc.
The user class contains all important information for the user itself. Also the a collection of groups, which implies the access right for the user.
All information of the user are saved in the database and the password is of course saved as password hash.
| lintel::User::User | ( | std::string | firstName, |
| std::string | lastName, | ||
| Sex | sex, | ||
| std::string | email, | ||
| std::string | userName, | ||
| std::string | password, | ||
| std::vector< Group > | groups, | ||
| std::chrono::sys_time< std::chrono::microseconds > | createdTimestamp = std::chrono::time_point_cast< std::chrono::microseconds >(std::chrono::system_clock::now()) |
||
| ) |
Constructor.
| firstName | user's first name |
| lastName | user's last name |
| sex | user's sex |
| user's email address | |
| userName | login username |
| password | password (will be hashed) |
| groups | groups this user belongs to |
| createdTimestamp | creation timestamp (defaults to now) |
| const std::chrono::sys_time< std::chrono::microseconds > & lintel::User::getCreatedTimestamp | ( | ) | const |
| const std::string & lintel::User::getEmail | ( | ) | const |
| const std::string & lintel::User::getFirstName | ( | ) | const |
| const std::string & lintel::User::getLastName | ( | ) | const |
| const std::string & lintel::User::getPassword | ( | ) | const |
| Sex lintel::User::getSex | ( | ) | const |
| const std::string & lintel::User::getUserName | ( | ) | const |
Check if the user belongs to the specified group (including subgroups).
| group | group to check |