Skip to content

Commit

Permalink
#1088 remove bdit_humans permissions from raw tables
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielwol committed Feb 7, 2025
1 parent 76585ff commit 97c31ed
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
4 changes: 2 additions & 2 deletions events/construction/rodars_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def process_lanesaffected(json_str):

def fetch_and_insert_issue_data(
select_conn = PostgresHook('rodars_postgres'),
insert_conn = PostgresHook('vds_bot'),
insert_conn = PostgresHook('events_bot'),
start_date = None
):
'''Fetch, process and insert data from ITS Central issuedata table.'''
Expand Down Expand Up @@ -112,7 +112,7 @@ def fetch_and_insert_issue_data(

def fetch_and_insert_location_data(
select_conn = PostgresHook('rodars_postgres'),
insert_conn = PostgresHook('vds_bot'),
insert_conn = PostgresHook('events_bot'),
start_date = None
):
'''Fetch, process and insert data from ITS Central issuelocationnew table.
Expand Down
8 changes: 2 additions & 6 deletions events/construction/sql/create-table-rodars_issues.sql
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,10 @@ CREATE TABLE IF NOT EXISTS congestion_events.rodars_issues

TABLESPACE pg_default;

ALTER TABLE IF EXISTS congestion_events.rodars_issues OWNER TO dbadmin;
ALTER TABLE IF EXISTS congestion_events.rodars_issues OWNER TO congestion_admins;

REVOKE ALL ON TABLE congestion_events.rodars_issues FROM bdit_humans;

GRANT SELECT ON TABLE congestion_events.rodars_issues TO bdit_humans;

GRANT ALL ON TABLE congestion_events.rodars_issues TO dbadmin;

GRANT ALL ON TABLE congestion_events.rodars_issues TO rds_superuser WITH GRANT OPTION;

GRANT ALL ON TABLE congestion_events.rodars_issues TO events_bot;
GRANT ALL ON TABLE congestion_events.rodars_issues TO events_bot;
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,12 @@ CREATE TABLE IF NOT EXISTS congestion_events.rodars_issue_locations

TABLESPACE pg_default;

ALTER TABLE IF EXISTS congestion_events.rodars_issue_locations OWNER TO dbadmin;
ALTER TABLE IF EXISTS congestion_events.rodars_issue_locations OWNER TO congestion_admins;

REVOKE ALL ON TABLE congestion_events.rodars_issue_locations FROM bdit_humans;
GRANT SELECT ON TABLE congestion_events.rodars_issue_locations TO bdit_humans;

GRANT ALL ON TABLE congestion_events.rodars_issue_locations TO dbadmin;

GRANT ALL ON TABLE congestion_events.rodars_issue_locations TO rds_superuser WITH GRANT OPTION;

GRANT ALL ON TABLE congestion_events.rodars_issue_locations TO events_bot;

Expand Down

0 comments on commit 97c31ed

Please sign in to comment.