-
Notifications
You must be signed in to change notification settings - Fork 599
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BYPASSRLS admin policy falllback (#4493)
* BYPASSRLS admin policy falllback * use fixed list instead --------- Co-authored-by: Ruben Fiszel <[email protected]>
- Loading branch information
1 parent
644dd87
commit e44decb
Showing
6 changed files
with
25 additions
and
78 deletions.
There are no files selected for viewing
12 changes: 0 additions & 12 deletions
12
backend/.sqlx/query-722a3096f03d25ef94292d53801d41037de4bc69dd434232029c731cbbcbc22f.json
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
backend/.sqlx/query-eb1f916f9beea3eea83ce359f5305d0cfb0d6cdba9cc56c6139f57e46345f843.json
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 @@ | ||
-- Add down migration script here |
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,24 @@ | ||
-- Add up migration script here | ||
DO | ||
$$ | ||
DECLARE | ||
tbl_name text; | ||
policy_exists boolean; | ||
tbl_names text[] := ARRAY['account', 'app', 'audit', 'capture', 'completed_job', 'flow', 'folder', 'http_trigger', 'queue', 'raw_app', 'resource', 'schedule', 'script', 'usr_to_group', 'variable']; | ||
BEGIN | ||
FOR tbl_name IN SELECT unnest(tbl_names) | ||
LOOP | ||
SELECT EXISTS ( | ||
SELECT 1 | ||
FROM pg_policies | ||
WHERE schemaname = 'public' | ||
AND tablename = tbl_name | ||
AND policyname = 'admin_policy' | ||
) INTO policy_exists; | ||
|
||
IF NOT policy_exists THEN | ||
EXECUTE format('CREATE POLICY admin_policy ON %I TO windmill_admin USING (true);', tbl_name); | ||
END IF; | ||
END LOOP; | ||
END; | ||
$$; |
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