Skip to content

Commit

Permalink
feat: removing certifier policy on application_revision table
Browse files Browse the repository at this point in the history
  • Loading branch information
pbastia committed Mar 23, 2021
1 parent 5442a91 commit 55782b3
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
8 changes: 8 additions & 0 deletions schema/deploy/policies/application_revision_policies_001.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-- Deploy ggircs-portal:policies/application_revision_policies_001 to pg
-- requires: policies/application_revision_policies

BEGIN;

drop policy certifier_select_application_revision on ggircs_portal.application_revision;

COMMIT;
18 changes: 18 additions & 0 deletions schema/revert/policies/application_revision_policies_001.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-- Revert ggircs-portal:policies/application_revision_policies_001 from pg

BEGIN;

do
$policy$
declare certifier_user_statement text;
begin

certifier_user_statement := 'application_id in (select ggircs_portal_private.get_valid_applications_for_certifier())';

-- ciip_industry_user (certifier) RLS
perform ggircs_portal_private.upsert_policy('certifier_select_application_revision', 'application_revision', 'select', 'ciip_industry_user', certifier_user_statement);

end
$policy$;

COMMIT;
1 change: 1 addition & 0 deletions schema/sqitch.plan
Original file line number Diff line number Diff line change
Expand Up @@ -279,3 +279,4 @@ database_functions/verify_type_not_present 2021-03-12T22:17:37Z Pierre Bastianel
types/search_certification_url_result [types/search_certification_url_result@v1.16.0] 2021-03-12T22:13:32Z Pierre Bastianelli <pierre.bastianelli@gov.bc.ca> # removing type as part of the certifier role deprecation
database_functions/verify_policy_not_present 2021-03-13T00:18:59Z Pierre Bastianelli <pierre.bastianelli@gov.bc.ca> # function to verify a policy doesn't exist on the system
policies/application_policies_001 [policies/application_policies] 2021-03-12T23:54:50Z Pierre Bastianelli <pierre.bastianelli@gov.bc.ca> # dropping certifier policies on application table
policies/application_revision_policies_001 [policies/application_revision_policies] 2021-03-13T01:03:12Z Pierre Bastianelli <pierre.bastianelli@gov.bc.ca> # removing the application revision policies linked to the certifier role
7 changes: 7 additions & 0 deletions schema/verify/policies/application_revision_policies_001.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-- Verify ggircs-portal:policies/application_revision_policies_001 on pg

BEGIN;

select ggircs_portal_private.verify_policy_not_present('certifier_select_application_revision', 'ggircs_portal.application_revision');

ROLLBACK;

0 comments on commit 55782b3

Please sign in to comment.