add delete_user_rls to user table
This commit is contained in:
@ -4,6 +4,6 @@
|
||||
|
||||
BEGIN;
|
||||
|
||||
-- do nothing here, there's no reason to undo this migration.
|
||||
REVOKE DELETE ON omnivore.user FROM omnivore_user;
|
||||
|
||||
COMMIT;
|
||||
|
||||
11
packages/db/migrations/0087.do.grant_delete_rls_on_user.sql
Executable file
11
packages/db/migrations/0087.do.grant_delete_rls_on_user.sql
Executable file
@ -0,0 +1,11 @@
|
||||
-- Type: DO
|
||||
-- Name: grant_delete_rls_on_users
|
||||
-- Description: Add RLS delete permission to the users table
|
||||
|
||||
BEGIN;
|
||||
|
||||
CREATE POLICY delete_users on omnivore.user
|
||||
FOR DELETE TO omnivore_user
|
||||
USING (id = omnivore.get_current_user_id());
|
||||
|
||||
COMMIT;
|
||||
9
packages/db/migrations/0087.undo.grant_delete_rls_on_user.sql
Executable file
9
packages/db/migrations/0087.undo.grant_delete_rls_on_user.sql
Executable file
@ -0,0 +1,9 @@
|
||||
-- Type: UNDO
|
||||
-- Name: grant_delete_rls_on_users
|
||||
-- Description: Add RLS delete permission to the users table
|
||||
|
||||
BEGIN;
|
||||
|
||||
DROP POLICY delete_users ON omnivore.user;
|
||||
|
||||
COMMIT;
|
||||
Reference in New Issue
Block a user