From 6cc8ca707f4c310383e89b9e2fe55dcc2c8f7ec2 Mon Sep 17 00:00:00 2001 From: Diogo Biazus Date: Tue, 8 Dec 2015 11:25:58 -0500 Subject: [PATCH] Separates privileges in another fixture --- test/SpecHelper.hs | 1 + test/fixtures/privileges.sql | 411 +++++++++++++++++++++++++++++++++++ test/fixtures/schema.sql | 389 +-------------------------------- 3 files changed, 423 insertions(+), 378 deletions(-) create mode 100644 test/fixtures/privileges.sql diff --git a/test/SpecHelper.hs b/test/SpecHelper.hs index 503dd3f06..d1176ace7 100644 --- a/test/SpecHelper.hs +++ b/test/SpecHelper.hs @@ -72,6 +72,7 @@ setupDb = do void $ readProcess "psql" ["-d", "postgres", "-a", "-f", "test/fixtures/database.sql"] [] loadFixture "roles" loadFixture "schema" + loadFixture "privileges" resetDb resetDb :: IO () diff --git a/test/fixtures/privileges.sql b/test/fixtures/privileges.sql new file mode 100644 index 000000000..05cad9aad --- /dev/null +++ b/test/fixtures/privileges.sql @@ -0,0 +1,411 @@ +-- +-- PostgreSQL database dump +-- + +-- Dumped from database version 9.5beta1 +-- Dumped by pg_dump version 9.5beta1 + +SET statement_timeout = 0; +SET lock_timeout = 0; +SET client_encoding = 'UTF8'; +SET standard_conforming_strings = on; +SET check_function_bodies = false; +SET client_min_messages = warning; +SET row_security = off; + +-- +-- Name: postgrest; Type: ACL; Schema: -; Owner: postgrest_test +-- + +REVOKE ALL ON SCHEMA postgrest FROM PUBLIC; +REVOKE ALL ON SCHEMA postgrest FROM postgrest_test; +GRANT ALL ON SCHEMA postgrest TO postgrest_test; +GRANT USAGE ON SCHEMA postgrest TO postgrest_anonymous; + + +-- +-- Name: public; Type: ACL; Schema: -; Owner: diogo +-- + +REVOKE ALL ON SCHEMA public FROM PUBLIC; +REVOKE ALL ON SCHEMA public FROM diogo; +GRANT ALL ON SCHEMA public TO diogo; +GRANT ALL ON SCHEMA public TO PUBLIC; + + +-- +-- Name: test; Type: ACL; Schema: -; Owner: postgrest_test +-- + +REVOKE ALL ON SCHEMA test FROM PUBLIC; +REVOKE ALL ON SCHEMA test FROM postgrest_test; +GRANT ALL ON SCHEMA test TO postgrest_test; +GRANT USAGE ON SCHEMA test TO postgrest_anonymous; +GRANT USAGE ON SCHEMA test TO postgrest_test_author; + + +SET search_path = test, pg_catalog; + +-- +-- Name: items; Type: ACL; Schema: test; Owner: postgrest_test +-- + +REVOKE ALL ON TABLE items FROM PUBLIC; +REVOKE ALL ON TABLE items FROM postgrest_test; +GRANT ALL ON TABLE items TO postgrest_test; +GRANT ALL ON TABLE items TO postgrest_anonymous; + + +SET search_path = public, pg_catalog; + +-- +-- Name: always_true(test.items); Type: ACL; Schema: public; Owner: postgrest_test +-- + +REVOKE ALL ON FUNCTION always_true(test.items) FROM PUBLIC; +REVOKE ALL ON FUNCTION always_true(test.items) FROM postgrest_test; +GRANT ALL ON FUNCTION always_true(test.items) TO postgrest_test; +GRANT ALL ON FUNCTION always_true(test.items) TO postgrest_anonymous; + + +SET search_path = test, pg_catalog; + +-- +-- Name: getitemrange(bigint, bigint); Type: ACL; Schema: test; Owner: postgrest_test +-- + +REVOKE ALL ON FUNCTION getitemrange(min bigint, max bigint) FROM PUBLIC; +REVOKE ALL ON FUNCTION getitemrange(min bigint, max bigint) FROM postgrest_test; +GRANT ALL ON FUNCTION getitemrange(min bigint, max bigint) TO postgrest_test; +GRANT ALL ON FUNCTION getitemrange(min bigint, max bigint) TO postgrest_anonymous; + + +-- +-- Name: login(text, text); Type: ACL; Schema: test; Owner: postgrest_test +-- + +REVOKE ALL ON FUNCTION login(id text, pass text) FROM PUBLIC; +REVOKE ALL ON FUNCTION login(id text, pass text) FROM postgrest_test; +GRANT ALL ON FUNCTION login(id text, pass text) TO postgrest_test; +GRANT ALL ON FUNCTION login(id text, pass text) TO postgrest_anonymous; + + +-- +-- Name: problem(); Type: ACL; Schema: test; Owner: postgrest_test +-- + +REVOKE ALL ON FUNCTION problem() FROM PUBLIC; +REVOKE ALL ON FUNCTION problem() FROM postgrest_test; +GRANT ALL ON FUNCTION problem() TO postgrest_test; +GRANT ALL ON FUNCTION problem() TO postgrest_test_author; + + +-- +-- Name: sayhello(text); Type: ACL; Schema: test; Owner: postgrest_test +-- + +REVOKE ALL ON FUNCTION sayhello(name text) FROM PUBLIC; +REVOKE ALL ON FUNCTION sayhello(name text) FROM postgrest_test; +GRANT ALL ON FUNCTION sayhello(name text) TO postgrest_test; +GRANT ALL ON FUNCTION sayhello(name text) TO postgrest_anonymous; + + +-- +-- Name: test_empty_rowset(); Type: ACL; Schema: test; Owner: postgrest_test +-- + +REVOKE ALL ON FUNCTION test_empty_rowset() FROM PUBLIC; +REVOKE ALL ON FUNCTION test_empty_rowset() FROM postgrest_test; +GRANT ALL ON FUNCTION test_empty_rowset() TO postgrest_test; +GRANT ALL ON FUNCTION test_empty_rowset() TO postgrest_anonymous; + + +SET search_path = postgrest, pg_catalog; + +-- +-- Name: auth; Type: ACL; Schema: postgrest; Owner: postgrest_test +-- + +REVOKE ALL ON TABLE auth FROM PUBLIC; +REVOKE ALL ON TABLE auth FROM postgrest_test; +GRANT ALL ON TABLE auth TO postgrest_test; +GRANT INSERT ON TABLE auth TO postgrest_anonymous; + + +SET search_path = private, pg_catalog; + +-- +-- Name: articles; Type: ACL; Schema: private; Owner: postgrest_test +-- + +REVOKE ALL ON TABLE articles FROM PUBLIC; +REVOKE ALL ON TABLE articles FROM postgrest_test; +GRANT ALL ON TABLE articles TO postgrest_test; + + +SET search_path = test, pg_catalog; + +-- +-- Name: articleStars; Type: ACL; Schema: test; Owner: postgrest_test +-- + +REVOKE ALL ON TABLE "articleStars" FROM PUBLIC; +REVOKE ALL ON TABLE "articleStars" FROM postgrest_test; +GRANT ALL ON TABLE "articleStars" TO postgrest_test; +GRANT ALL ON TABLE "articleStars" TO postgrest_anonymous; + + +-- +-- Name: articles; Type: ACL; Schema: test; Owner: postgrest_test +-- + +REVOKE ALL ON TABLE articles FROM PUBLIC; +REVOKE ALL ON TABLE articles FROM postgrest_test; +GRANT ALL ON TABLE articles TO postgrest_test; +GRANT ALL ON TABLE articles TO postgrest_anonymous; + + +-- +-- Name: authors_only; Type: ACL; Schema: test; Owner: postgrest_test +-- + +REVOKE ALL ON TABLE authors_only FROM PUBLIC; +REVOKE ALL ON TABLE authors_only FROM postgrest_test; +GRANT ALL ON TABLE authors_only TO postgrest_test; +GRANT ALL ON TABLE authors_only TO postgrest_test_author; + + +-- +-- Name: auto_incrementing_pk; Type: ACL; Schema: test; Owner: postgrest_test +-- + +REVOKE ALL ON TABLE auto_incrementing_pk FROM PUBLIC; +REVOKE ALL ON TABLE auto_incrementing_pk FROM postgrest_test; +GRANT ALL ON TABLE auto_incrementing_pk TO postgrest_test; +GRANT ALL ON TABLE auto_incrementing_pk TO postgrest_anonymous; + + +-- +-- Name: auto_incrementing_pk_id_seq; Type: ACL; Schema: test; Owner: postgrest_test +-- + +REVOKE ALL ON SEQUENCE auto_incrementing_pk_id_seq FROM PUBLIC; +REVOKE ALL ON SEQUENCE auto_incrementing_pk_id_seq FROM postgrest_test; +GRANT ALL ON SEQUENCE auto_incrementing_pk_id_seq TO postgrest_test; +GRANT USAGE ON SEQUENCE auto_incrementing_pk_id_seq TO postgrest_anonymous; + + +-- +-- Name: clients; Type: ACL; Schema: test; Owner: postgrest_test +-- + +REVOKE ALL ON TABLE clients FROM PUBLIC; +REVOKE ALL ON TABLE clients FROM postgrest_test; +GRANT ALL ON TABLE clients TO postgrest_test; +GRANT ALL ON TABLE clients TO postgrest_anonymous; + + +-- +-- Name: comments; Type: ACL; Schema: test; Owner: postgrest_test +-- + +REVOKE ALL ON TABLE comments FROM PUBLIC; +REVOKE ALL ON TABLE comments FROM postgrest_test; +GRANT ALL ON TABLE comments TO postgrest_test; +GRANT ALL ON TABLE comments TO postgrest_anonymous; + + +-- +-- Name: complex_items; Type: ACL; Schema: test; Owner: postgrest_test +-- + +REVOKE ALL ON TABLE complex_items FROM PUBLIC; +REVOKE ALL ON TABLE complex_items FROM postgrest_test; +GRANT ALL ON TABLE complex_items TO postgrest_test; +GRANT ALL ON TABLE complex_items TO postgrest_anonymous; + + +-- +-- Name: compound_pk; Type: ACL; Schema: test; Owner: postgrest_test +-- + +REVOKE ALL ON TABLE compound_pk FROM PUBLIC; +REVOKE ALL ON TABLE compound_pk FROM postgrest_test; +GRANT ALL ON TABLE compound_pk TO postgrest_test; +GRANT ALL ON TABLE compound_pk TO postgrest_anonymous; + + +-- +-- Name: has_count_column; Type: ACL; Schema: test; Owner: postgrest_test +-- + +REVOKE ALL ON TABLE has_count_column FROM PUBLIC; +REVOKE ALL ON TABLE has_count_column FROM postgrest_test; +GRANT ALL ON TABLE has_count_column TO postgrest_test; +GRANT ALL ON TABLE has_count_column TO postgrest_anonymous; + + +-- +-- Name: has_fk; Type: ACL; Schema: test; Owner: postgrest_test +-- + +REVOKE ALL ON TABLE has_fk FROM PUBLIC; +REVOKE ALL ON TABLE has_fk FROM postgrest_test; +GRANT ALL ON TABLE has_fk TO postgrest_test; +GRANT ALL ON TABLE has_fk TO postgrest_anonymous; + + +-- +-- Name: insertable_view_with_join; Type: ACL; Schema: test; Owner: postgrest_test +-- + +REVOKE ALL ON TABLE insertable_view_with_join FROM PUBLIC; +REVOKE ALL ON TABLE insertable_view_with_join FROM postgrest_test; +GRANT ALL ON TABLE insertable_view_with_join TO postgrest_test; +GRANT ALL ON TABLE insertable_view_with_join TO postgrest_anonymous; + + +-- +-- Name: items_id_seq; Type: ACL; Schema: test; Owner: postgrest_test +-- + +REVOKE ALL ON SEQUENCE items_id_seq FROM PUBLIC; +REVOKE ALL ON SEQUENCE items_id_seq FROM postgrest_test; +GRANT ALL ON SEQUENCE items_id_seq TO postgrest_test; +GRANT USAGE ON SEQUENCE items_id_seq TO postgrest_anonymous; + + +-- +-- Name: json; Type: ACL; Schema: test; Owner: postgrest_test +-- + +REVOKE ALL ON TABLE json FROM PUBLIC; +REVOKE ALL ON TABLE json FROM postgrest_test; +GRANT ALL ON TABLE json TO postgrest_test; +GRANT ALL ON TABLE json TO postgrest_anonymous; + + +-- +-- Name: materialized_view; Type: ACL; Schema: test; Owner: postgrest_test +-- + +REVOKE ALL ON TABLE materialized_view FROM PUBLIC; +REVOKE ALL ON TABLE materialized_view FROM postgrest_test; +GRANT ALL ON TABLE materialized_view TO postgrest_test; +GRANT ALL ON TABLE materialized_view TO postgrest_anonymous; + + +-- +-- Name: menagerie; Type: ACL; Schema: test; Owner: postgrest_test +-- + +REVOKE ALL ON TABLE menagerie FROM PUBLIC; +REVOKE ALL ON TABLE menagerie FROM postgrest_test; +GRANT ALL ON TABLE menagerie TO postgrest_test; +GRANT ALL ON TABLE menagerie TO postgrest_anonymous; + + +-- +-- Name: no_pk; Type: ACL; Schema: test; Owner: postgrest_test +-- + +REVOKE ALL ON TABLE no_pk FROM PUBLIC; +REVOKE ALL ON TABLE no_pk FROM postgrest_test; +GRANT ALL ON TABLE no_pk TO postgrest_test; +GRANT ALL ON TABLE no_pk TO postgrest_anonymous; + + +-- +-- Name: nullable_integer; Type: ACL; Schema: test; Owner: postgrest_test +-- + +REVOKE ALL ON TABLE nullable_integer FROM PUBLIC; +REVOKE ALL ON TABLE nullable_integer FROM postgrest_test; +GRANT ALL ON TABLE nullable_integer TO postgrest_test; +GRANT ALL ON TABLE nullable_integer TO postgrest_anonymous; + + +-- +-- Name: projects; Type: ACL; Schema: test; Owner: postgrest_test +-- + +REVOKE ALL ON TABLE projects FROM PUBLIC; +REVOKE ALL ON TABLE projects FROM postgrest_test; +GRANT ALL ON TABLE projects TO postgrest_test; +GRANT ALL ON TABLE projects TO postgrest_anonymous; + + +-- +-- Name: projects_view; Type: ACL; Schema: test; Owner: postgrest_test +-- + +REVOKE ALL ON TABLE projects_view FROM PUBLIC; +REVOKE ALL ON TABLE projects_view FROM postgrest_test; +GRANT ALL ON TABLE projects_view TO postgrest_test; +GRANT ALL ON TABLE projects_view TO postgrest_anonymous; + + +-- +-- Name: simple_pk; Type: ACL; Schema: test; Owner: postgrest_test +-- + +REVOKE ALL ON TABLE simple_pk FROM PUBLIC; +REVOKE ALL ON TABLE simple_pk FROM postgrest_test; +GRANT ALL ON TABLE simple_pk TO postgrest_test; +GRANT ALL ON TABLE simple_pk TO postgrest_anonymous; + + +-- +-- Name: tasks; Type: ACL; Schema: test; Owner: postgrest_test +-- + +REVOKE ALL ON TABLE tasks FROM PUBLIC; +REVOKE ALL ON TABLE tasks FROM postgrest_test; +GRANT ALL ON TABLE tasks TO postgrest_test; +GRANT ALL ON TABLE tasks TO postgrest_anonymous; + + +-- +-- Name: tsearch; Type: ACL; Schema: test; Owner: postgrest_test +-- + +REVOKE ALL ON TABLE tsearch FROM PUBLIC; +REVOKE ALL ON TABLE tsearch FROM postgrest_test; +GRANT ALL ON TABLE tsearch TO postgrest_test; +GRANT ALL ON TABLE tsearch TO postgrest_anonymous; + + +-- +-- Name: users; Type: ACL; Schema: test; Owner: postgrest_test +-- + +REVOKE ALL ON TABLE users FROM PUBLIC; +REVOKE ALL ON TABLE users FROM postgrest_test; +GRANT ALL ON TABLE users TO postgrest_test; +GRANT ALL ON TABLE users TO postgrest_anonymous; + + +-- +-- Name: users_projects; Type: ACL; Schema: test; Owner: postgrest_test +-- + +REVOKE ALL ON TABLE users_projects FROM PUBLIC; +REVOKE ALL ON TABLE users_projects FROM postgrest_test; +GRANT ALL ON TABLE users_projects TO postgrest_test; +GRANT ALL ON TABLE users_projects TO postgrest_anonymous; + + +-- +-- Name: users_tasks; Type: ACL; Schema: test; Owner: postgrest_test +-- + +REVOKE ALL ON TABLE users_tasks FROM PUBLIC; +REVOKE ALL ON TABLE users_tasks FROM postgrest_test; +GRANT ALL ON TABLE users_tasks TO postgrest_test; +GRANT ALL ON TABLE users_tasks TO postgrest_anonymous; + + +-- +-- PostgreSQL database dump complete +-- + diff --git a/test/fixtures/schema.sql b/test/fixtures/schema.sql index db4f5c464..ff69c7edf 100755 --- a/test/fixtures/schema.sql +++ b/test/fixtures/schema.sql @@ -39,11 +39,6 @@ CREATE SCHEMA test; CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog; - --- --- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: - --- - SET search_path = public, pg_catalog; -- @@ -371,6 +366,16 @@ CREATE TABLE compound_pk ( ); +-- +-- Name: empty_table; Type: TABLE; Schema: test; Owner: - +-- + +CREATE TABLE empty_table ( + k character varying NOT NULL, + extra character varying NOT NULL +); + + -- -- Name: has_count_column; Type: VIEW; Schema: test; Owner: - -- @@ -526,10 +531,6 @@ CREATE TABLE simple_pk ( extra character varying NOT NULL ); -CREATE TABLE empty_table ( - k character varying NOT NULL, - extra character varying NOT NULL -); -- -- Name: tasks; Type: TABLE; Schema: test; Owner: - @@ -886,375 +887,7 @@ ALTER TABLE ONLY users_tasks ADD CONSTRAINT users_tasks_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id); --- --- Name: postgrest; Type: ACL; Schema: -; Owner: - --- - -REVOKE ALL ON SCHEMA postgrest FROM PUBLIC; -REVOKE ALL ON SCHEMA postgrest FROM postgrest_test; -GRANT ALL ON SCHEMA postgrest TO postgrest_test; -GRANT USAGE ON SCHEMA postgrest TO postgrest_anonymous; - --- --- Name: test; Type: ACL; Schema: -; Owner: - --- - -GRANT ALL ON SCHEMA test TO postgrest_test; -GRANT USAGE ON SCHEMA test TO postgrest_anonymous; -GRANT USAGE ON SCHEMA test TO postgrest_test_author; - - --- --- Name: items; Type: ACL; Schema: test; Owner: - --- - -REVOKE ALL ON TABLE items FROM PUBLIC; -REVOKE ALL ON TABLE items FROM postgrest_test; -GRANT ALL ON TABLE items TO postgrest_test; -GRANT ALL ON TABLE items TO postgrest_anonymous; - - -SET search_path = public, pg_catalog; - --- --- Name: always_true(test.items); Type: ACL; Schema: public; Owner: - --- - -REVOKE ALL ON FUNCTION always_true(test.items) FROM PUBLIC; -REVOKE ALL ON FUNCTION always_true(test.items) FROM postgrest_test; -GRANT ALL ON FUNCTION always_true(test.items) TO postgrest_test; -GRANT ALL ON FUNCTION always_true(test.items) TO postgrest_anonymous; - - -SET search_path = test, pg_catalog; - --- --- Name: getitemrange(bigint, bigint); Type: ACL; Schema: test; Owner: - --- - -REVOKE ALL ON FUNCTION getitemrange(min bigint, max bigint) FROM PUBLIC; -GRANT ALL ON FUNCTION getitemrange(min bigint, max bigint) TO postgrest_test; -GRANT ALL ON FUNCTION getitemrange(min bigint, max bigint) TO postgrest_anonymous; - - --- --- Name: login(text, text); Type: ACL; Schema: test; Owner: - --- - -REVOKE ALL ON FUNCTION login(id text, pass text) FROM PUBLIC; -GRANT ALL ON FUNCTION login(id text, pass text) TO postgrest_test; -GRANT ALL ON FUNCTION login(id text, pass text) TO postgrest_anonymous; - - --- --- Name: problem(); Type: ACL; Schema: test; Owner: - --- - -REVOKE ALL ON FUNCTION problem() FROM PUBLIC; -GRANT ALL ON FUNCTION problem() TO postgrest_test_author; - - --- --- Name: sayhello(text); Type: ACL; Schema: test; Owner: - --- - -REVOKE ALL ON FUNCTION sayhello(name text) FROM PUBLIC; -GRANT ALL ON FUNCTION sayhello(name text) TO postgrest_test; -GRANT ALL ON FUNCTION sayhello(name text) TO postgrest_anonymous; - - --- --- Name: test_empty_rowset(); Type: ACL; Schema: test; Owner: - --- - -REVOKE ALL ON FUNCTION test_empty_rowset() FROM PUBLIC; -GRANT ALL ON FUNCTION test_empty_rowset() TO postgrest_test; -GRANT ALL ON FUNCTION test_empty_rowset() TO postgrest_anonymous; - - -SET search_path = postgrest, pg_catalog; - --- --- Name: auth; Type: ACL; Schema: postgrest; Owner: - --- - -REVOKE ALL ON TABLE auth FROM PUBLIC; -REVOKE ALL ON TABLE auth FROM postgrest_test; -GRANT ALL ON TABLE auth TO postgrest_test; -GRANT INSERT ON TABLE auth TO postgrest_anonymous; - - -SET search_path = private, pg_catalog; - --- --- Name: articles; Type: ACL; Schema: private; Owner: - --- - -REVOKE ALL ON TABLE articles FROM PUBLIC; -REVOKE ALL ON TABLE articles FROM postgrest_test; -GRANT ALL ON TABLE articles TO postgrest_test; - - -SET search_path = test, pg_catalog; - --- --- Name: articleStars; Type: ACL; Schema: test; Owner: - --- - -REVOKE ALL ON TABLE "articleStars" FROM PUBLIC; -REVOKE ALL ON TABLE "articleStars" FROM postgrest_test; -GRANT ALL ON TABLE "articleStars" TO postgrest_test; -GRANT ALL ON TABLE "articleStars" TO postgrest_anonymous; - - --- --- Name: articles; Type: ACL; Schema: test; Owner: - --- - -REVOKE ALL ON TABLE articles FROM PUBLIC; -REVOKE ALL ON TABLE articles FROM postgrest_test; -GRANT ALL ON TABLE articles TO postgrest_test; -GRANT ALL ON TABLE articles TO postgrest_anonymous; - - --- --- Name: authors_only; Type: ACL; Schema: test; Owner: - --- - -REVOKE ALL ON TABLE authors_only FROM PUBLIC; -REVOKE ALL ON TABLE authors_only FROM postgrest_test_author; -GRANT ALL ON TABLE authors_only TO postgrest_test_author; - - --- --- Name: auto_incrementing_pk; Type: ACL; Schema: test; Owner: - --- - -REVOKE ALL ON TABLE auto_incrementing_pk FROM PUBLIC; -REVOKE ALL ON TABLE auto_incrementing_pk FROM postgrest_test; -GRANT ALL ON TABLE auto_incrementing_pk TO postgrest_test; -GRANT ALL ON TABLE auto_incrementing_pk TO postgrest_anonymous; - - --- --- Name: auto_incrementing_pk_id_seq; Type: ACL; Schema: test; Owner: - --- - -REVOKE ALL ON SEQUENCE auto_incrementing_pk_id_seq FROM PUBLIC; -REVOKE ALL ON SEQUENCE auto_incrementing_pk_id_seq FROM postgrest_test; -GRANT ALL ON SEQUENCE auto_incrementing_pk_id_seq TO postgrest_test; -GRANT USAGE ON SEQUENCE auto_incrementing_pk_id_seq TO postgrest_anonymous; - - --- --- Name: clients; Type: ACL; Schema: test; Owner: - --- - -REVOKE ALL ON TABLE clients FROM PUBLIC; -REVOKE ALL ON TABLE clients FROM postgrest_test; -GRANT ALL ON TABLE clients TO postgrest_test; -GRANT ALL ON TABLE clients TO postgrest_anonymous; - - --- --- Name: comments; Type: ACL; Schema: test; Owner: - --- - -REVOKE ALL ON TABLE comments FROM PUBLIC; -REVOKE ALL ON TABLE comments FROM postgrest_test; -GRANT ALL ON TABLE comments TO postgrest_test; -GRANT ALL ON TABLE comments TO postgrest_anonymous; - - --- --- Name: complex_items; Type: ACL; Schema: test; Owner: - --- - -REVOKE ALL ON TABLE complex_items FROM PUBLIC; -REVOKE ALL ON TABLE complex_items FROM postgrest_test; -GRANT ALL ON TABLE complex_items TO postgrest_test; -GRANT ALL ON TABLE complex_items TO postgrest_anonymous; - - --- --- Name: compound_pk; Type: ACL; Schema: test; Owner: - --- - -REVOKE ALL ON TABLE compound_pk FROM PUBLIC; -REVOKE ALL ON TABLE compound_pk FROM postgrest_test; -GRANT ALL ON TABLE compound_pk TO postgrest_test; -GRANT ALL ON TABLE compound_pk TO postgrest_anonymous; - - --- --- Name: has_count_column; Type: ACL; Schema: test; Owner: - --- - -REVOKE ALL ON TABLE has_count_column FROM PUBLIC; -GRANT ALL ON TABLE has_count_column TO postgrest_test; -GRANT ALL ON TABLE has_count_column TO postgrest_anonymous; - - --- --- Name: has_fk; Type: ACL; Schema: test; Owner: - --- - -REVOKE ALL ON TABLE has_fk FROM PUBLIC; -REVOKE ALL ON TABLE has_fk FROM postgrest_test; -GRANT ALL ON TABLE has_fk TO postgrest_test; -GRANT ALL ON TABLE has_fk TO postgrest_anonymous; - - --- --- Name: insertable_view_with_join; Type: ACL; Schema: test; Owner: - --- - -REVOKE ALL ON TABLE insertable_view_with_join FROM PUBLIC; -REVOKE ALL ON TABLE insertable_view_with_join FROM postgrest_test; -GRANT ALL ON TABLE insertable_view_with_join TO postgrest_test; -GRANT ALL ON TABLE insertable_view_with_join TO postgrest_anonymous; - - --- --- Name: items_id_seq; Type: ACL; Schema: test; Owner: - --- - -REVOKE ALL ON SEQUENCE items_id_seq FROM PUBLIC; -REVOKE ALL ON SEQUENCE items_id_seq FROM postgrest_test; -GRANT ALL ON SEQUENCE items_id_seq TO postgrest_test; -GRANT USAGE ON SEQUENCE items_id_seq TO postgrest_anonymous; - - --- --- Name: json; Type: ACL; Schema: test; Owner: - --- - -REVOKE ALL ON TABLE json FROM PUBLIC; -REVOKE ALL ON TABLE json FROM postgrest_test; -GRANT ALL ON TABLE json TO postgrest_test; -GRANT ALL ON TABLE json TO postgrest_anonymous; - - --- --- Name: materialized_view; Type: ACL; Schema: test; Owner: - --- - -REVOKE ALL ON TABLE materialized_view FROM PUBLIC; -REVOKE ALL ON TABLE materialized_view FROM postgrest_test; -GRANT ALL ON TABLE materialized_view TO postgrest_test; -GRANT ALL ON TABLE materialized_view TO postgrest_anonymous; - - --- --- Name: menagerie; Type: ACL; Schema: test; Owner: - --- - -REVOKE ALL ON TABLE menagerie FROM PUBLIC; -REVOKE ALL ON TABLE menagerie FROM postgrest_test; -GRANT ALL ON TABLE menagerie TO postgrest_test; -GRANT ALL ON TABLE menagerie TO postgrest_anonymous; - - --- --- Name: no_pk; Type: ACL; Schema: test; Owner: - --- - -REVOKE ALL ON TABLE no_pk FROM PUBLIC; -REVOKE ALL ON TABLE no_pk FROM postgrest_test; -GRANT ALL ON TABLE no_pk TO postgrest_test; -GRANT ALL ON TABLE no_pk TO postgrest_anonymous; - - --- --- Name: nullable_integer; Type: ACL; Schema: test; Owner: - --- - -REVOKE ALL ON TABLE nullable_integer FROM PUBLIC; -REVOKE ALL ON TABLE nullable_integer FROM postgrest_test; -GRANT ALL ON TABLE nullable_integer TO postgrest_test; -GRANT ALL ON TABLE nullable_integer TO postgrest_anonymous; - - --- --- Name: projects; Type: ACL; Schema: test; Owner: - --- - -REVOKE ALL ON TABLE projects FROM PUBLIC; -REVOKE ALL ON TABLE projects FROM postgrest_test; -GRANT ALL ON TABLE projects TO postgrest_test; -GRANT ALL ON TABLE projects TO postgrest_anonymous; - - --- --- Name: projects_view; Type: ACL; Schema: test; Owner: - --- - -REVOKE ALL ON TABLE projects_view FROM PUBLIC; -REVOKE ALL ON TABLE projects_view FROM postgrest_test; -GRANT ALL ON TABLE projects_view TO postgrest_test; -GRANT ALL ON TABLE projects_view TO postgrest_anonymous; - - --- --- Name: simple_pk; Type: ACL; Schema: test; Owner: - --- - -REVOKE ALL ON TABLE simple_pk FROM PUBLIC; -REVOKE ALL ON TABLE simple_pk FROM postgrest_test; -GRANT ALL ON TABLE simple_pk TO postgrest_test; -GRANT ALL ON TABLE simple_pk TO postgrest_anonymous; - - --- --- Name: tasks; Type: ACL; Schema: test; Owner: - --- - -REVOKE ALL ON TABLE tasks FROM PUBLIC; -REVOKE ALL ON TABLE tasks FROM postgrest_test; -GRANT ALL ON TABLE tasks TO postgrest_test; -GRANT ALL ON TABLE tasks TO postgrest_anonymous; - - --- --- Name: tsearch; Type: ACL; Schema: test; Owner: - --- - -REVOKE ALL ON TABLE tsearch FROM PUBLIC; -REVOKE ALL ON TABLE tsearch FROM postgrest_test; -GRANT ALL ON TABLE tsearch TO postgrest_test; -GRANT ALL ON TABLE tsearch TO postgrest_anonymous; - - --- --- Name: users; Type: ACL; Schema: test; Owner: - --- - -REVOKE ALL ON TABLE users FROM PUBLIC; -REVOKE ALL ON TABLE users FROM postgrest_test; -GRANT ALL ON TABLE users TO postgrest_test; -GRANT ALL ON TABLE users TO postgrest_anonymous; - - --- --- Name: users_projects; Type: ACL; Schema: test; Owner: - --- - -REVOKE ALL ON TABLE users_projects FROM PUBLIC; -REVOKE ALL ON TABLE users_projects FROM postgrest_test; -GRANT ALL ON TABLE users_projects TO postgrest_test; -GRANT ALL ON TABLE users_projects TO postgrest_anonymous; - - --- --- Name: users_tasks; Type: ACL; Schema: test; Owner: - --- - -REVOKE ALL ON TABLE users_tasks FROM PUBLIC; -REVOKE ALL ON TABLE users_tasks FROM postgrest_test; -GRANT ALL ON TABLE users_tasks TO postgrest_test; -GRANT ALL ON TABLE users_tasks TO postgrest_anonymous; - - -- -- PostgreSQL database dump complete -- +