Skip to content

Commit

Permalink
grant access to payments_rides for non-agency users (#1714)
Browse files Browse the repository at this point in the history
* grant access to payments_rides for non-agency users

* just use calitp domain and add a couple other users
  • Loading branch information
atvaccaro authored Aug 29, 2022
1 parent 6817264 commit 062321b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 4 additions & 0 deletions warehouse/macros/create_row_access_policy.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ grant to (
{% endfor %}
)
filter using (
{% if not filter_column and not filter_value %}
1 = 1
{% else %}
{{ filter_column }} = '{{ filter_value }}'
{% endif %}
)
{% endmacro %}
14 changes: 12 additions & 2 deletions warehouse/models/payments_views/payments_rides.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{{ config(
post_hook=[" {{ create_row_access_policy(
post_hook=[
" {{ create_row_access_policy(
filter_column = 'participant_id',
filter_value = 'mst',
principals = ['serviceAccount:[email protected]']
Expand All @@ -18,7 +19,16 @@
filter_column = 'participant_id',
filter_value = 'clean-air-express',
principals = ['serviceAccount:clean-air-payments-user@cal-itp-data-infra.iam.gserviceaccount.com']
) }}"
) }}",
" {{ create_row_access_policy(
principals = ['serviceAccount:[email protected]',
'group:[email protected]',
'domain:calitp.org',
'user:[email protected]',
'user:[email protected]',
'user:[email protected]',
]
) }}",
]

) }}
Expand Down

0 comments on commit 062321b

Please sign in to comment.