Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-cpplib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-cpplib
Merge requests
!42
Release 0.2.0
Code
Review changes
Check out branch
Open in Workspace
Download
Patches
Plain diff
Expand sidebar
Closed
Release 0.2.0
release-0.2.0
into
main
Overview
0
Commits
87
Pipelines
1
Changes
14
Closed
Timm Fitschen
requested to merge
release-0.2.0
into
main
2 years ago
Overview
0
Commits
87
Pipelines
1
Changes
14
0
0
Merge request reports
Viewing commit
78f84606
Prev
Next
Show latest version
14 files
+
46
−
936
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
14
Verified
78f84606
REVERT: Remove implementation for role (temporarily)
· 78f84606
Timm Fitschen
authored
3 years ago
include/caosdb/acm/permission_rule.h deleted
100644 → 0
+
0
−
69
View file @ 714d02d2
/*
* This file is a part of the CaosDB Project.
*
* Copyright (C) 2022 Timm Fitschen <t.fitschen@indiscale.com>
* Copyright (C) 2022 IndiScale GmbH <info@indiscale.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
/**
* @brief PermissionRules grant or deny permissions to roles.
*
* @file caosdb/acm/permission_rule.h
* @author Timm Fitchen
* @date 2022-02-11
*/
#ifdef BUILD_ACM
#ifndef CAOSDB_ACM_PERMISSION_RULE_H
#define CAOSDB_ACM_PERMISSION_RULE_H
#include
<stddef.h>
// for size_t
#include
<unordered_set>
// for unordered_set
#include
<string>
// for string
namespace
caosdb
::
acm
{
class
PermissionRuleImpl
;
class
PermissionRule
{
public:
PermissionRule
(
std
::
string
permission
,
bool
isGrant
,
bool
isPriority
);
explicit
PermissionRule
(
PermissionRuleImpl
*
wrapped
);
PermissionRule
(
const
PermissionRule
&
rule
);
auto
operator
=
(
const
PermissionRule
&
rule
)
->
PermissionRule
&
;
~
PermissionRule
();
auto
ToString
()
const
->
std
::
string
;
[[
nodiscard
]]
auto
IsGrant
()
const
->
bool
;
auto
SetGrant
(
bool
isGrant
)
->
void
;
[[
nodiscard
]]
auto
IsPriority
()
const
->
bool
;
auto
SetPriority
(
bool
isPriority
)
->
void
;
[[
nodiscard
]]
auto
GetPermission
()
const
->
const
std
::
string
&
;
auto
operator
==
(
const
PermissionRule
&
other
)
const
->
bool
;
private:
PermissionRuleImpl
*
impl
;
};
struct
HashPermissionRule
{
auto
operator
()(
const
PermissionRule
&
rule
)
const
->
size_t
;
};
using
PermissionRules
=
std
::
unordered_set
<
PermissionRule
,
HashPermissionRule
>
;
}
// namespace caosdb::acm
#endif
#endif
Loading