Created
July 19, 2018 00:46
-
-
Save cdaringe/85dd9a7b1278afe4770869dc494216f3 to your computer and use it in GitHub Desktop.
postgres-rls-rejecting-inserts-with-loose-policy
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
testing=> \d testing.report_files | |
Table "testing.report_files" | |
Column | Type | Modifiers | |
---------------------+---------+------------------------------------------------------------------ | |
id | integer | not null default nextval('testing.report_files_id_seq'::regclass) | |
idp_organization_id | text | not null | |
name | text | not null | |
description | text | | |
Indexes: | |
"report_files_pkey" PRIMARY KEY, btree (id) | |
"unique_report_name_in_org" UNIQUE, btree (idp_organization_id, name) | |
"report_idpoid" btree (idp_organization_id) | |
Policies: | |
POLICY "files" FOR ALL | |
USING (true) | |
testing=> insert into testing.report_files (idp_organization_id, name, description) values ('1', 'a', 'b'); | |
ERROR: permission denied for sequence report_files_id_seq | |
testing=> select * from testing.report_files; | |
id | idp_organization_id | name | description | |
----+---------------------+---------------+--------------------------- | |
1 | 1 | test_report_0 | test_report_0_description |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment