-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added DB migration script for the snapshot/locking feature endpoint p…
…ermissions
- Loading branch information
1 parent
a025aad
commit 04eeb68
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
.../db/migration/postgresql/V2.15.0.20250210100000__conceptset_snapshot_lock_permissions.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
|
||
|
||
INSERT INTO ${ohdsiSchema}.sec_permission (id, value, description) | ||
SELECT nextval('${ohdsiSchema}.sec_permission_id_seq'), 'conceptset:*:snapshot:post', 'Invoke Concept Set Snapshot Action'; | ||
|
||
INSERT INTO ${ohdsiSchema}.sec_permission (id, value, description) | ||
SELECT nextval('${ohdsiSchema}.sec_permission_id_seq'), 'conceptset:*:list-snapshots:get', 'List Concept Set Snapshots'; | ||
|
||
INSERT INTO ${ohdsiSchema}.sec_permission (id, value, description) | ||
SELECT nextval('${ohdsiSchema}.sec_permission_id_seq'), 'conceptset:check-locked:post', 'Batch-Check Concept Set Locked Snapshots'; | ||
|
||
INSERT INTO ${ohdsiSchema}.sec_permission (id, value, description) | ||
SELECT nextval('${ohdsiSchema}.sec_permission_id_seq'), 'conceptset:get-snapshot-items:post', 'Fetch Concept Set Snapshot Items'; | ||
|
||
|
||
INSERT INTO ${ohdsiSchema}.sec_role_permission(id, role_id, permission_id) | ||
SELECT nextval('${ohdsiSchema}.sec_role_permission_sequence'), sr.id, sp.id | ||
FROM ${ohdsiSchema}.sec_permission SP, ${ohdsiSchema}.sec_role sr | ||
WHERE sp.value IN ( | ||
'conceptset:*:snapshot:post', | ||
'conceptset:*:list-snapshots:get', | ||
'conceptset:check-locked:post', | ||
'conceptset:get-snapshot-items:post' | ||
) AND sr.name IN ('admin'); | ||
|
||
INSERT INTO ${ohdsiSchema}.sec_role_permission(id, role_id, permission_id) | ||
SELECT nextval('${ohdsiSchema}.sec_role_permission_sequence'), sr.id, sp.id | ||
FROM ${ohdsiSchema}.sec_permission SP, ${ohdsiSchema}.sec_role sr | ||
WHERE sp.value IN ( | ||
'conceptset:*:list-snapshots:get', | ||
'conceptset:check-locked:post', | ||
'conceptset:get-snapshot-items:post' | ||
) AND sr.name IN ('Atlas users'); |