Cutelyst
2.14.0
Cutelyst
Plugins
Authentication
authenticationstore.cpp
1
/*
2
* Copyright (C) 2013-2017 Daniel Nicoletti <dantti12@gmail.com>
3
*
4
* This library is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU Lesser General Public
6
* License as published by the Free Software Foundation; either
7
* version 2.1 of the License, or (at your option) any later version.
8
*
9
* This library is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
* Lesser General Public License for more details.
13
*
14
* You should have received a copy of the GNU Lesser General Public
15
* License along with this library; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
*/
18
#include "authenticationstore.h"
19
20
#include <QVariant>
21
22
using namespace
Cutelyst
;
23
24
AuthenticationStore::AuthenticationStore
(QObject *parent) : QObject(parent)
25
{
26
27
}
28
29
AuthenticationStore::~AuthenticationStore()
30
{
31
32
}
33
34
bool
AuthenticationStore::canAutoCreateUser
()
const
35
{
36
return
false
;
37
}
38
39
AuthenticationUser
AuthenticationStore::autoCreateUser
(
Context
*c,
const
ParamsMultiMap
&userinfo)
const
40
{
41
Q_UNUSED(c)
42
Q_UNUSED(userinfo)
43
return
AuthenticationUser
();
44
}
45
46
bool
AuthenticationStore::canAutoUpdateUser
()
const
47
{
48
return
false
;
49
}
50
51
AuthenticationUser
AuthenticationStore::autoUpdateUser
(
Context
*c,
const
ParamsMultiMap
&userinfo)
const
52
{
53
Q_UNUSED(c)
54
Q_UNUSED(userinfo)
55
return
AuthenticationUser
();
56
}
57
58
QVariant
AuthenticationStore::forSession
(
Context
*c,
const
AuthenticationUser
&user)
59
{
60
Q_UNUSED(c)
61
return
QVariant::fromValue(user);
62
}
63
64
AuthenticationUser
AuthenticationStore::fromSession
(
Context
*c,
const
QVariant &frozenUser)
65
{
66
Q_UNUSED(c)
67
return
frozenUser.value<
AuthenticationUser
>();
68
}
69
70
#include "moc_authenticationstore.cpp"
Cutelyst::Context
The Cutelyst Context.
Definition:
context.h:51
Cutelyst::AuthenticationUser
Definition:
authenticationuser.h:31
Cutelyst::AuthenticationStore::canAutoCreateUser
virtual bool canAutoCreateUser() const
Definition:
authenticationstore.cpp:34
Cutelyst::AuthenticationStore::fromSession
virtual AuthenticationUser fromSession(Context *c, const QVariant &frozenUser)
Definition:
authenticationstore.cpp:64
QMap
Cutelyst::AuthenticationStore::canAutoUpdateUser
virtual bool canAutoUpdateUser() const
Definition:
authenticationstore.cpp:46
Cutelyst
The Cutelyst namespace holds all public Cutelyst API.
Definition:
Mainpage.dox:7
Cutelyst::AuthenticationStore::autoUpdateUser
virtual AuthenticationUser autoUpdateUser(Context *c, const ParamsMultiMap &userinfo) const
Definition:
authenticationstore.cpp:51
Cutelyst::AuthenticationStore::AuthenticationStore
AuthenticationStore(QObject *parent=nullptr)
Definition:
authenticationstore.cpp:24
Cutelyst::AuthenticationStore::autoCreateUser
virtual AuthenticationUser autoCreateUser(Context *c, const ParamsMultiMap &userinfo) const
Definition:
authenticationstore.cpp:39
Cutelyst::AuthenticationStore::forSession
virtual QVariant forSession(Context *c, const AuthenticationUser &user)
Definition:
authenticationstore.cpp:58
Generated by
1.8.17