Grant SELECT on payment_status to guest

It is necessary to send the details email from the notification handler.
This commit is contained in:
jordi fita mas 2024-02-29 17:49:51 +01:00
parent 0ba088e5e2
commit 365fed55b1
6 changed files with 41 additions and 2 deletions

View File

@ -0,0 +1,11 @@
-- Deploy camper:grant_select_on_payment_status_to_guest to pg
-- requires: roles
-- requires: payment_status
-- requires: payment_status_i18n
begin;
grant select on table camper.payment_status to guest;
grant select on table camper.payment_status_i18n to guest;
commit;

View File

@ -0,0 +1,8 @@
-- Revert camper:grant_select_on_payment_status_to_guest from pg
begin;
revoke select on camper.payment_status_i18n from guest;
revoke select on camper.payment_status from guest;
commit;

View File

@ -261,3 +261,4 @@ payment_reference [roles schema_camper payment] 2024-02-14T01:45:37Z jordi fita
@v4 2024-02-27T17:30:17Z jordi fita mas <jordi@tandem.blog> # Tag v4
company__tourist_tax_max_days [company] 2024-02-27T18:03:51Z jordi fita mas <jordi@tandem.blog> # Add tourist_tax_max_days to company
draft_payment [draft_payment@v4 company__tourist_tax_max_days] 2024-02-27T17:49:05Z jordi fita mas <jordi@tandem.blog> # Limit the number of nights that have tourist tax in draft_payment
grant_select_on_payment_status_to_guest [roles payment_status payment_status_i18n] 2024-02-29T16:42:13Z jordi fita mas <jordi@tandem.blog> # Grant SELECT on payment_status and payment_status_i18n to guest

View File

@ -11,7 +11,7 @@ set search_path to camper, public;
select has_table('payment_status');
select has_pk('payment_status');
select table_privs_are('payment_status', 'guest', array[]::text[]);
select table_privs_are('payment_status', 'guest', array['SELECT']);
select table_privs_are('payment_status', 'employee', array['SELECT']);
select table_privs_are('payment_status', 'admin', array['SELECT']);
select table_privs_are('payment_status', 'authenticator', array[]::text[]);

View File

@ -12,7 +12,7 @@ set search_path to camper, public;
select has_table('payment_status_i18n');
select has_pk('payment_status_i18n');
select col_is_pk('payment_status_i18n', array['payment_status', 'lang_tag']);
select table_privs_are('payment_status_i18n', 'guest', array[]::text[]);
select table_privs_are('payment_status_i18n', 'guest', array['SELECT']);
select table_privs_are('payment_status_i18n', 'employee', array['SELECT']);
select table_privs_are('payment_status_i18n', 'admin', array['SELECT']);
select table_privs_are('payment_status_i18n', 'authenticator', array[]::text[]);

View File

@ -0,0 +1,19 @@
-- Verify camper:grant_select_on_payment_status_to_guest on pg
begin;
select 1 / count(*) from information_schema.table_privileges
where table_schema = 'camper'
and table_name = 'payment_status'
and grantee = 'guest'
and privilege_type = 'SELECT'
;
select 1 / count(*) from information_schema.table_privileges
where table_schema = 'camper'
and table_name = 'payment_status_i18n'
and grantee = 'guest'
and privilege_type = 'SELECT'
;
rollback;