alter read_labels policy to check user_id

This commit is contained in:
Hongbo Wu
2024-04-16 11:41:19 +08:00
parent d79cc1c39f
commit 6ce95194ee
2 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,11 @@
-- Type: DO
-- Name: alter_labels_table_policy
-- Description: Alter labels table select policy to check user_id
BEGIN;
ALTER POLICY read_labels ON omnivore.labels
TO omnivore_user
USING (user_id = omnivore.get_current_user_id());
COMMIT;

View File

@ -0,0 +1,11 @@
-- Type: UNDO
-- Name: alter_labels_table_policy
-- Description: Alter labels table select policy to check user_id
BEGIN;
ALTER POLICY read_labels ON omnivore.labels
TO omnivore_user
USING (true);
COMMIT;