ORE Studio 0.0.4
Loading...
Searching...
No Matches
permission.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 *
3 * Copyright (C) 2025 Marco Craveiro <marco.craveiro@gmail.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License as published by the Free Software
7 * Foundation; either version 3 of the License, or (at your option) any later
8 * version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 * details.
14 *
15 * You should have received a copy of the GNU General Public License along with
16 * this program; if not, write to the Free Software Foundation, Inc., 51
17 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 *
19 */
20#ifndef ORES_IAM_DOMAIN_PERMISSION_HPP
21#define ORES_IAM_DOMAIN_PERMISSION_HPP
22
23#include <string>
24#include <boost/uuid/uuid.hpp>
25
26namespace ores::iam::domain {
27
41struct permission final {
45 boost::uuids::uuid id;
46
53 std::string code;
54
58 std::string description;
59};
60
64namespace permissions {
65 // Account management
66 constexpr auto accounts_create = "accounts:create";
67 constexpr auto accounts_read = "accounts:read";
68 constexpr auto accounts_update = "accounts:update";
69 constexpr auto accounts_delete = "accounts:delete";
70 constexpr auto accounts_lock = "accounts:lock";
71 constexpr auto accounts_unlock = "accounts:unlock";
72 constexpr auto accounts_reset_password = "accounts:reset_password";
73
74 // Currency management
75 constexpr auto currencies_create = "currencies:create";
76 constexpr auto currencies_read = "currencies:read";
77 constexpr auto currencies_update = "currencies:update";
78 constexpr auto currencies_delete = "currencies:delete";
79 constexpr auto currencies_history = "currencies:history";
80
81 // Feature flags management
82 constexpr auto flags_create = "flags:create";
83 constexpr auto flags_read = "flags:read";
84 constexpr auto flags_update = "flags:update";
85 constexpr auto flags_delete = "flags:delete";
86
87 // Login info (read-only audit data)
88 constexpr auto login_info_read = "login_info:read";
89
90 // Roles management
91 constexpr auto roles_create = "roles:create";
92 constexpr auto roles_read = "roles:read";
93 constexpr auto roles_update = "roles:update";
94 constexpr auto roles_delete = "roles:delete";
95 constexpr auto roles_assign = "roles:assign";
96 constexpr auto roles_revoke = "roles:revoke";
97
98 // Data Quality - Change reasons
99 constexpr auto change_reasons_read = "change_reasons:read";
100 constexpr auto change_reasons_write = "change_reasons:write";
101 constexpr auto change_reasons_delete = "change_reasons:delete";
102
103 // Data Quality - Change reason categories
104 constexpr auto change_reason_categories_read = "change_reason_categories:read";
105 constexpr auto change_reason_categories_write = "change_reason_categories:write";
106 constexpr auto change_reason_categories_delete = "change_reason_categories:delete";
107
108 // Data Quality - Catalogs
109 constexpr auto catalogs_read = "catalogs:read";
110 constexpr auto catalogs_write = "catalogs:write";
111 constexpr auto catalogs_delete = "catalogs:delete";
112
113 // Data Quality - Data domains
114 constexpr auto data_domains_read = "data_domains:read";
115 constexpr auto data_domains_write = "data_domains:write";
116 constexpr auto data_domains_delete = "data_domains:delete";
117
118 // Data Quality - Subject areas
119 constexpr auto subject_areas_read = "subject_areas:read";
120 constexpr auto subject_areas_write = "subject_areas:write";
121 constexpr auto subject_areas_delete = "subject_areas:delete";
122
123 // Data Quality - Datasets
124 constexpr auto datasets_read = "datasets:read";
125 constexpr auto datasets_write = "datasets:write";
126 constexpr auto datasets_delete = "datasets:delete";
127
128 // Data Quality - Methodologies
129 constexpr auto methodologies_read = "methodologies:read";
130 constexpr auto methodologies_write = "methodologies:write";
131 constexpr auto methodologies_delete = "methodologies:delete";
132
133 // Data Quality - Coding schemes
134 constexpr auto coding_schemes_read = "coding_schemes:read";
135 constexpr auto coding_schemes_write = "coding_schemes:write";
136 constexpr auto coding_schemes_delete = "coding_schemes:delete";
137
138 // Data Quality - Coding scheme authority types
139 constexpr auto coding_scheme_authority_types_read = "coding_scheme_authority_types:read";
140 constexpr auto coding_scheme_authority_types_write = "coding_scheme_authority_types:write";
141 constexpr auto coding_scheme_authority_types_delete = "coding_scheme_authority_types:delete";
142
143 // Data Quality - Nature dimensions
144 constexpr auto nature_dimensions_read = "nature_dimensions:read";
145 constexpr auto nature_dimensions_write = "nature_dimensions:write";
146 constexpr auto nature_dimensions_delete = "nature_dimensions:delete";
147
148 // Data Quality - Origin dimensions
149 constexpr auto origin_dimensions_read = "origin_dimensions:read";
150 constexpr auto origin_dimensions_write = "origin_dimensions:write";
151 constexpr auto origin_dimensions_delete = "origin_dimensions:delete";
152
153 // Data Quality - Treatment dimensions
154 constexpr auto treatment_dimensions_read = "treatment_dimensions:read";
155 constexpr auto treatment_dimensions_write = "treatment_dimensions:write";
156 constexpr auto treatment_dimensions_delete = "treatment_dimensions:delete";
157
158 // Data Quality - Dataset bundles
159 constexpr auto dataset_bundles_read = "dataset_bundles:read";
160 constexpr auto dataset_bundles_write = "dataset_bundles:write";
161 constexpr auto dataset_bundles_delete = "dataset_bundles:delete";
162
163 // Data Quality - Dataset bundle members
164 constexpr auto dataset_bundle_members_read = "dataset_bundle_members:read";
165 constexpr auto dataset_bundle_members_write = "dataset_bundle_members:write";
166 constexpr auto dataset_bundle_members_delete = "dataset_bundle_members:delete";
167
168 // Wildcard - grants all permissions
169 constexpr auto all = "*";
170}
171
172}
173
174#endif
Domain types for identity and access management.
Definition account.hpp:27
Represents an atomic permission that can be granted to roles.
Definition permission.hpp:41
std::string description
Human-readable description of what this permission allows.
Definition permission.hpp:58
std::string code
Permission code following the format "resource:action".
Definition permission.hpp:53
boost::uuids::uuid id
Unique identifier for the permission.
Definition permission.hpp:45