Files
omnivore/packages/db/migrations/0007.undo.read_access_all_user_friends.sql
2022-02-11 09:24:33 -08:00

14 lines
383 B
PL/PgSQL
Executable File

-- Type: UNDO
-- Name: read_access_all_user_friends
-- Description: Grant read access to user_friends to app role
BEGIN;
DROP POLICY read_all_user_friends ON omnivore.user_friends;
CREATE POLICY read_user_friends ON omnivore.user_friends
FOR SELECT TO omnivore_user
USING (user_id = omnivore.get_current_user_id() OR friend_user_id = omnivore.get_current_user_id());
COMMIT;