cutelyst
4.5.1
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
|
Container for user data retrieved from an AuthenticationStore. More...
#include <Cutelyst/Plugins/Authentication/authenticationuser.h>
Public Member Functions | |
AuthenticationUser () | |
AuthenticationUser (const QVariant &id) | |
virtual | ~AuthenticationUser () |
QString | authRealm () |
QVariantMap | data () const |
QVariant | id () const |
void | insert (const QString &key, const QVariant &value) |
bool | isNull () const |
operator QVariant () const | |
void | setAuthRealm (const QString &authRealm) |
void | setData (const QVariantMap &data) |
void | setId (const QVariant &id) |
QVariant | value (const QString &key, const QVariant &defaultValue=QVariant()) const |
Protected Attributes | |
QVariantMap | m_data |
Create this object in your reimplementation of AuthenticationStore::findUser() and populate it with the data retrieved from your store.
For an example implementation see Authentication overview.
Definition at line 29 of file authenticationuser.h.
AuthenticationUser::AuthenticationUser | ( | ) |
Constructs a new AuthenticationUser object.
Definition at line 12 of file authenticationuser.cpp.
AuthenticationUser::AuthenticationUser | ( | const QVariant & | id | ) |
Constructs a new AuthenticationUser object with the given id.
Definition at line 16 of file authenticationuser.cpp.
References setId().
|
virtual |
Destroys the AuthenticationUser object.
Definition at line 21 of file authenticationuser.cpp.
QString AuthenticationUser::authRealm | ( | ) |
Returns the authentication realm from which this user was retrieved.
Definition at line 40 of file authenticationuser.cpp.
Referenced by Cutelyst::AuthenticationRealm::findUser(), and setAuthRealm().
|
inline |
Returns the internal data object.
Definition at line 106 of file authenticationuser.h.
Referenced by setData().
QVariant AuthenticationUser::id | ( | ) | const |
A unique ID by which a AuthenticationUser can be retrieved from the store.
Definition at line 25 of file authenticationuser.cpp.
Referenced by Cutelyst::StoreHtpasswd::forSession(), and Cutelyst::StoreMinimal::forSession().
Inserts a new item with the key key and a value of value.
If there is already an item with the key key, that item's value is replaced with value.
Definition at line 116 of file authenticationuser.h.
References value().
Referenced by Cutelyst::StoreHtpasswd::findUser().
bool AuthenticationUser::isNull | ( | ) | const |
Returns true
if the object is null.
Definition at line 35 of file authenticationuser.cpp.
Referenced by Cutelyst::CredentialHttp::authenticate(), Cutelyst::CredentialPassword::authenticate(), Cutelyst::Authentication::authenticate(), Cutelyst::AuthenticationRealm::findUser(), Cutelyst::AuthenticationRealm::restoreUser(), Cutelyst::Authentication::user(), and Cutelyst::Authentication::userInRealm().
void AuthenticationUser::setAuthRealm | ( | const QString & | authRealm | ) |
Sets the authentication realm from which this user was retrieved.
Definition at line 45 of file authenticationuser.cpp.
References authRealm().
Referenced by Cutelyst::AuthenticationRealm::findUser(), and Cutelyst::AuthenticationRealm::restoreUser().
|
inline |
Directly sets the internal data object.
Definition at line 111 of file authenticationuser.h.
References data().
void AuthenticationUser::setId | ( | const QVariant & | id | ) |
Sets the unique user id restored from the store
Definition at line 30 of file authenticationuser.cpp.
Referenced by AuthenticationUser(), and Cutelyst::StoreHtpasswd::findUser().
|
inline |
Returns the value associated with the key key.
If the internal map contains no item with key key, the function returns defaultValue. If no defaultValue is specified, the function returns a default-constructed value.
Definition at line 121 of file authenticationuser.h.
Referenced by Cutelyst::RoleACL::canVisit(), insert(), Cutelyst::Authentication::user(), and Cutelyst::Authentication::userInRealm().