UniSet @VERSION@
AccessConfig.h
1/*
2 * Copyright (c) 2025 Pavel Vainerman.
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as
6 * published by the Free Software Foundation, version 2.1.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Lesser Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16// -----------------------------------------------------------------------------
17#ifndef AccessConfig_H_
18#define AccessConfig_H_
19// -----------------------------------------------------------------------------
20#include <list>
21#include <memory>
22#include <unordered_map>
23#include <string>
24
25#include "AccessMask.h"
26#include "UniXML.h"
27#include "Configuration.h"
28// -----------------------------------------------------------------------------
29namespace uniset
30{
31 using PermissionsMap = std::unordered_map<uniset::ObjectId, uniset::AccessMask>;
32 struct ACL
33 {
34 AccessMask defaultPermissions;
35 PermissionsMap permissions;
36 };
37
38 using ACLMap = std::unordered_map< std::string, std::shared_ptr<ACL> >;
39 using ACLPtr = std::shared_ptr<ACL>;
40
41 struct ACLInfo
42 {
44 std::string name = { "" };
45 };
46
47 typedef std::unordered_map<uniset::ObjectId, ACLInfo> ACLInfoMap;
48
62 {
63 public:
64
65 static ACLMap read( std::shared_ptr<Configuration>& conf,
66 const std::shared_ptr<UniXML>& _xml,
67 const std::string& name,
68 const std::string& section="ACLConfig" );
69
70 private:
71 };
72 // -----------------------------------------------------------------------------
73} // namespace uniset
74// -----------------------------------------------------------------------------
75#endif // AccessConfig_H_
76// -----------------------------------------------------------------------------
Definition AccessConfig.h:62
Definition AccessMask.h:29
Definition AccessConfig.h:30
const ObjectId DefaultObjectId
Definition UniSetTypes.h:71
long ObjectId
Definition UniSetTypes_i.idl:30
Definition AccessConfig.h:33
Definition AccessConfig.h:42