The problem I’m having
using dbt grants in dbt_project.yml
I am successfully granting select on tables/views to the list of users/groups provided. But at no point are the users/groups granted usage on schema
.
This leaves me with a hacky solution:
on-run-end:
- >-
{% if target.name == 'prod' or target.name == 'qa' %}
{% set marts_schema = 'mrp_reporting' if target.name == 'prod' else 'qa_mrp_reporting' %}
grant usage on schema {{ marts_schema }} to group dbt_reporter;
{% endif %}
I would think the dbt grants would take care of everything needed to allow a user to select from a table, including usage on the schema. Since the schemas are created on the fly by dbt, it is tough to grant usage ahead of time.
Am I missing something?