From e89e4ab45a8ff04634b93272915df28d131df4c0 Mon Sep 17 00:00:00 2001 From: Anne Marsan Date: Thu, 14 Nov 2024 12:22:41 -0500 Subject: [PATCH] Add a migration to add the required permission for clearing the cache --- ...0.20241113115700__add_clearcache_permission.sql | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/main/resources/db/migration/postgresql/V2.15.0.20241113115700__add_clearcache_permission.sql diff --git a/src/main/resources/db/migration/postgresql/V2.15.0.20241113115700__add_clearcache_permission.sql b/src/main/resources/db/migration/postgresql/V2.15.0.20241113115700__add_clearcache_permission.sql new file mode 100644 index 000000000..b2ba6fc69 --- /dev/null +++ b/src/main/resources/db/migration/postgresql/V2.15.0.20241113115700__add_clearcache_permission.sql @@ -0,0 +1,14 @@ +INSERT INTO ${ohdsiSchema}.sec_permission (id, value, description) +SELECT nextval('${ohdsiSchema}.sec_permission_id_seq'), + 'cdmresults:clearcache:post', + 'Clear the achilles and cdm results caches'; + +INSERT INTO ${ohdsiSchema}.sec_role_permission (role_id, permission_id) +SELECT sr.id, sp.id +FROM ${ohdsiSchema}.sec_permission sp, + ${ohdsiSchema}.sec_role sr +WHERE sp."value" in + ( + 'cdmresults:clearcache:post' + ) + AND sr.name IN ('admin');