Leosac  0.7.0
OpenSourceAccessControl
AuthFwd.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 <cstddef>
23 #include <memory>
24 #include <odb/lazy-ptr.hxx>
25 
26 namespace Leosac
27 {
28 namespace Auth
29 {
30 class User;
31 using UserPtr = std::shared_ptr<User>;
32 using UserLPtr = odb::lazy_shared_ptr<User>;
33 using UserLWPtr = odb::lazy_weak_ptr<User>;
34 using UserId = unsigned long;
35 
36 class Group;
37 using GroupPtr = std::shared_ptr<Group>;
38 using GroupWPtr = std::weak_ptr<Group>;
39 using GroupLWPtr = odb::lazy_weak_ptr<Group>;
40 using GroupLPtr = odb::lazy_shared_ptr<Group>;
41 using GroupId = unsigned long;
42 
44 using SimpleAccessProfilePtr = std::shared_ptr<SimpleAccessProfile>;
45 
49 enum class GroupRank
50 {
51  MEMBER = 0,
52  OPERATOR = 1,
53  ADMIN = 2,
54 };
55 
56 enum class UserRank
57 {
61  USER = 0,
65  VIEWER = 1,
69  MANAGER = 2,
73  SUPERVISOR = 3,
77  ADMIN = 4,
78 };
79 
81 using UserGroupMembershipPtr = std::shared_ptr<UserGroupMembership>;
82 using UserGroupMembershipId = unsigned long;
83 
84 class Token;
85 using TokenPtr = std::shared_ptr<Token>;
86 
87 class IAccessProfile;
88 using IAccessProfilePtr = std::shared_ptr<IAccessProfile>;
89 
90 class ValidityInfo;
91 
92 class AuthTarget;
93 using AuthTargetPtr = std::shared_ptr<AuthTarget>;
94 
96 using IAuthenticationSourcePtr = std::shared_ptr<IAuthenticationSource>;
97 
98 class BaseAuthSource;
99 using BaseAuthSourcePtr = std::shared_ptr<BaseAuthSource>;
100 
101 class WiegandCard;
102 
103 class IDoor;
104 using IDoorPtr = std::shared_ptr<IDoor>;
105 using IDoorLPtr = odb::lazy_shared_ptr<IDoor>;
106 using IDoorLWPtr = odb::lazy_weak_ptr<IDoor>;
107 using DoorId = unsigned long;
108 
109 class Door;
110 using DoorLWPtr = odb::lazy_weak_ptr<Door>;
111 using DoorLPtr = odb::lazy_shared_ptr<Door>;
112 using DoorPtr = std::shared_ptr<Door>;
113 
114 
115 class IZone;
116 using IZonePtr = std::shared_ptr<IZone>;
117 using IZoneLPtr = odb::lazy_shared_ptr<IZone>;
118 using IZoneLWPtr = odb::lazy_weak_ptr<IZone>;
119 using ZoneId = unsigned long;
120 
121 class Zone;
122 using ZoneLWPtr = odb::lazy_weak_ptr<Zone>;
123 using ZoneLPtr = odb::lazy_shared_ptr<Zone>;
124 using ZonePtr = std::shared_ptr<Zone>;
125 
126 class IAccessPoint;
127 using IAccessPointPtr = std::shared_ptr<IAccessPoint>;
128 using AccessPointId = unsigned long;
129 
130 class AccessPoint;
131 using AccessPointLWPtr = odb::lazy_weak_ptr<AccessPoint>;
132 using AccessPointLPtr = odb::lazy_shared_ptr<AccessPoint>;
133 using AccessPointPtr = std::shared_ptr<AccessPoint>;
134 
135 class AccessPointUpdate;
136 using AccessPointUpdatePtr = std::shared_ptr<AccessPointUpdate>;
137 using AccessPointUpdateLPtr = odb::lazy_shared_ptr<AccessPointUpdate>;
138 }
139 }
std::shared_ptr< AuthTarget > AuthTargetPtr
Definition: AuthFwd.hpp:93
An authentication token used for authenticating a user against Leosac.
Definition: Token.hpp:42
std::shared_ptr< Token > TokenPtr
Definition: AuthFwd.hpp:85
Has viewing permission.
odb::lazy_weak_ptr< AccessPoint > AccessPointLWPtr
Definition: AuthFwd.hpp:131
unsigned long AccessPointId
Definition: AuthFwd.hpp:128
Represent an object that we are authorizing against (a door).
Definition: AuthTarget.hpp:37
std::shared_ptr< IZone > IZonePtr
Definition: AuthFwd.hpp:116
This is the header file for a generated source file, GitSHA1.cpp.
odb::lazy_shared_ptr< Door > DoorLPtr
Definition: AuthFwd.hpp:111
Can access user management aswel as credential management.
Holds information about access permission.
An interface for access point.
odb::lazy_shared_ptr< AccessPoint > AccessPointLPtr
Definition: AuthFwd.hpp:132
unsigned long UserGroupMembershipId
Definition: AuthFwd.hpp:82
odb::lazy_shared_ptr< User > UserLPtr
Definition: AuthFwd.hpp:32
A simple class that stores (and can be queried for) the validity of some objects. ...
A authentication group regroup users that share permissions.
Definition: Group.hpp:57
std::shared_ptr< AccessPointUpdate > AccessPointUpdatePtr
Definition: AuthFwd.hpp:136
std::shared_ptr< IDoor > IDoorPtr
Definition: AuthFwd.hpp:104
std::shared_ptr< IAccessPoint > IAccessPointPtr
Definition: AuthFwd.hpp:127
Represent a door.
Definition: Door.hpp:35
unsigned long GroupId
Definition: AuthFwd.hpp:41
unsigned long UserId
Definition: AuthFwd.hpp:34
A Zone is a container for doors and other zone.
Definition: Zone.hpp:60
unsigned long DoorId
Definition: AuthFwd.hpp:107
odb::lazy_shared_ptr< IZone > IZoneLPtr
Definition: AuthFwd.hpp:117
std::shared_ptr< IAccessProfile > IAccessProfilePtr
Definition: AuthFwd.hpp:88
std::shared_ptr< Group > GroupPtr
Definition: AuthFwd.hpp:37
std::shared_ptr< Door > DoorPtr
Definition: AuthFwd.hpp:112
odb::lazy_shared_ptr< Zone > ZoneLPtr
Definition: AuthFwd.hpp:123
std::shared_ptr< User > UserPtr
Definition: AuthFwd.hpp:31
GroupRank
The rank of an User inside a Group.
Definition: AuthFwd.hpp:49
Full access except changing user role.
std::shared_ptr< UserGroupMembership > UserGroupMembershipPtr
Definition: AuthFwd.hpp:81
std::shared_ptr< BaseAuthSource > BaseAuthSourcePtr
Definition: AuthFwd.hpp:99
Concrete implementation of a simple access control class.
odb::lazy_weak_ptr< Group > GroupLWPtr
Definition: AuthFwd.hpp:39
odb::lazy_shared_ptr< AccessPointUpdate > AccessPointUpdateLPtr
Definition: AuthFwd.hpp:137
odb::lazy_weak_ptr< IDoor > IDoorLWPtr
Definition: AuthFwd.hpp:106
Describe the membership of an User with regroup to a Group.
odb::lazy_weak_ptr< IZone > IZoneLWPtr
Definition: AuthFwd.hpp:118
std::shared_ptr< AccessPoint > AccessPointPtr
Definition: AuthFwd.hpp:133
unsigned long ZoneId
Definition: AuthFwd.hpp:119
odb::lazy_weak_ptr< User > UserLWPtr
Definition: AuthFwd.hpp:33
std::weak_ptr< Group > GroupWPtr
Definition: AuthFwd.hpp:38
std::shared_ptr< SimpleAccessProfile > SimpleAccessProfilePtr
Definition: AuthFwd.hpp:44
odb::lazy_weak_ptr< Door > DoorLWPtr
Definition: AuthFwd.hpp:110
std::shared_ptr< IAuthenticationSource > IAuthenticationSourcePtr
Definition: AuthFwd.hpp:96
std::shared_ptr< Zone > ZonePtr
Definition: AuthFwd.hpp:124
An Auth source is a card id, a pin code, a fingerprint, etc...
odb::lazy_shared_ptr< Group > GroupLPtr
Definition: AuthFwd.hpp:40
The interface for zones.
Definition: IZone.hpp:47
odb::lazy_shared_ptr< IDoor > IDoorLPtr
Definition: AuthFwd.hpp:105
odb::lazy_weak_ptr< Zone > ZoneLWPtr
Definition: AuthFwd.hpp:122