-
Notifications
You must be signed in to change notification settings - Fork 0
/
Access.h
58 lines (48 loc) · 1.63 KB
/
Access.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: Access.h
* Author: Benjamin
*
* Created on 1 février 2017, 15:59
*/
#ifndef ACCESS_H
#define ACCESS_H
#include <memory>
#include "Credential.h"
#include "Server.h"
#include "User.h"
namespace Spatch
{
namespace Configuration
{
class Access
{
public:
enum CredentialType
{
Provided,
UserCred,
Asked
};
Access(const std::string &id, const std::shared_ptr<User> user, const std::shared_ptr<Credential> cred, const std::shared_ptr<Server> serv);
Access(const std::string &id, const std::shared_ptr<User> user, const CredentialType type, const std::shared_ptr<Server> serv);
~Access();
const std::string &getId() const;
const std::shared_ptr<Server> getServer() const;
const std::shared_ptr<User> getUser() const;
const std::shared_ptr<Credential> getCredential() const;
const CredentialType getCredentialType() const;
private:
std::string _id;
std::shared_ptr<Credential> _cred;
std::shared_ptr<User> _user;
std::shared_ptr<Server> _serv;
CredentialType _type;
};
}
}
#endif /* ACCESS_H */