Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-mysqlbackend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-mysqlbackend
Commits
f02f23b0
Commit
f02f23b0
authored
2 years ago
by
Henrik tom Wörden
Browse files
Options
Downloads
Patches
Plain Diff
ENH: add procedure to collect ACL for a set of entities
parent
26292eb6
No related branches found
No related tags found
No related merge requests found
Pipeline
#25800
failed
2 years ago
Stage: test
Stage: deploy
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
procedures/getACLForEntitySet.sql
+48
-0
48 additions, 0 deletions
procedures/getACLForEntitySet.sql
with
48 additions
and
0 deletions
procedures/getACLForEntitySet.sql
0 → 100644
+
48
−
0
View file @
f02f23b0
/*
* This file is a part of the CaosDB Project.
*
* Copyright (C) 2022 IndiScale GmbH
* Copyright (C) 2022 Henrik tom Wörden
*
* 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/>.
*
*/
/**
* Creates a table with the columns (entity ID, acl) from a given table with
* entity IDs. Here, acl in the string representation of the acl.
* Parameters
* ----------
*
* entitySet: table with list of IDs
*/
DELIMITER
//
DROP
PROCEDURE
IF
EXISTS
db_5_0
.
applyPOV
;
CREATE
OR
REPLACE
PROCEDURE
db_5_0
.
getACLForEntitySet
(
in
entitySet
VARCHAR
(
255
))
BEGIN
-- TODO in future one might want to retrieve only a distinct set of acl
-- with (acl_id, acl) and a table with (entity_id, acl_id) to reduce the
-- amount of data being transfered
-- TODO Double check: Versioning is not an issue here since acl is not
-- versioned.
SET
@
stmtStr
=
CONCAT
(
'SELECT entity_n_acl.id, entity_acl.acl from '
,
'(select entities.id, entities.acl from entities where id in (select id from `'
,
entitySet
,
'`) ) as entity_n_acl inner join entity_acl on entity_n_acl.acl=entity_acl.id;'
,)
PREPARE
stmt
FROM
@
stmtStr
;
EXECUTE
stmt
;
END
//
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment