Leosac  0.8.0
Open Source Access Control
IAuthSourceMapper.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2014-2016 Leosac
3 
4  This file is part of Leosac.
5 
6  Leosac is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Affero General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  Leosac is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Affero General Public License for more details.
15 
16  You should have received a copy of the GNU Affero General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #pragma once
21 
22 #include "core/auth/Group.hpp"
24 #include "tools/Visitor.hpp"
25 
26 namespace Leosac
27 {
28 namespace Auth
29 {
30 class WiegandCard;
31 class PINCode;
32 class WiegandCardPin;
33 
43 class IAuthSourceMapper : public Leosac::Tools::Visitor<WiegandCard>,
44  public Leosac::Tools::Visitor<PINCode>,
45  public Leosac::Tools::Visitor<WiegandCardPin>
46 {
47  public:
48  virtual ~IAuthSourceMapper() = default;
49 
58  virtual void mapToUser(Cred::ICredentialPtr cred) = 0;
59 
69  virtual IAccessProfilePtr buildProfile(Cred::ICredentialPtr auth_source) = 0;
70 
74  virtual std::vector<Leosac::Auth::GroupPtr> groups() const = 0;
75 };
76 }
77 }
Leosac::Auth::IAuthSourceMapper::groups
virtual std::vector< Leosac::Auth::GroupPtr > groups() const =0
Return the groups this mapper is aware of.
Leosac::Auth::IAuthSourceMapper::mapToUser
virtual void mapToUser(Cred::ICredentialPtr cred)=0
Must map the ICredential data to a User.
Leosac::Auth::IAccessProfilePtr
std::shared_ptr< IAccessProfile > IAccessProfilePtr
Definition: AuthFwd.hpp:88
Leosac::Tools::Visitor
A Visitor object.
Definition: Visitor.hpp:64
Leosac::Auth::IAuthSourceMapper::~IAuthSourceMapper
virtual ~IAuthSourceMapper()=default
Leosac
This is the header file for a generated source file, GitSHA1.cpp.
Definition: APIStatusCode.hpp:22
Group.hpp
Visitor.hpp
Leosac::Auth::IAuthSourceMapper
Base class to perform abstracted mapping operation over various AuthSource object.
Definition: IAuthSourceMapper.hpp:43
Leosac::Cred::ICredentialPtr
std::shared_ptr< ICredential > ICredentialPtr
Definition: CredentialFwd.hpp:32
Leosac::Auth::IAuthSourceMapper::buildProfile
virtual IAccessProfilePtr buildProfile(Cred::ICredentialPtr auth_source)=0
Build an AccessProfile object given a Credential.
IAuthenticationSource.hpp