Skip to content

Commit

Permalink
Add more warehouses to database permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
agnessnowplow committed Aug 17, 2023
1 parent d2d3a81 commit 32396db
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 3 deletions.
4 changes: 2 additions & 2 deletions website/docs/faqs/Warehouse/database-privileges.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ schema¹
* read system <Term id="view">views</Term> to generate documentation (i.e. views in
`information_schema`)

On Postgres, Redshift, and Snowflake, use a series of `grants` to ensure that
your user has the correct privileges.
On Postgres, Redshift, Databricks, and Snowflake, use a series of `grants` to ensure that
your user has the correct privileges. Check out [example permissions](/reference/database-permissions/snowflake-permissions) for these warehouses.

On BigQuery, use the "BigQuery User" role to assign these privileges.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: "Databricks Permissions"
---

## Example Databricks permissions

```
-- NOTE: in general permissions can be granted on securable_objects to
principals (can be user, service principal, or group)
-- e.g.: grant privilege_type on securable_object to principal
grant all privileges on schema schema_name to principal;
grant create table on schema schema_name to principal;
grant create view on schema schema_name to principal;
```

Check out the [Official Documentation](https://docs.databricks.com/en/data-governance/unity-catalog/manage-privileges/privileges.html#privilege-types-by-securable-object-in-unity-catalog) for more information.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: "Postgres Permissions"
---

## Example Postgres permissions

```
grant usage on database database_name to user_name;
grant create schema on database database_name to user_name;
grant usage on schema database.schema_name to user_name;
grant create table on schema database.schema_name to user_name;
grant create view on schema database.schema_name to user_name;
grant usage on all schemas in database database_name to user_name;
grant select on all tables in database database_name to user_name;
grant select on all views in database database_name to user_name;
```

Check out the [Official Documentation](https://www.postgresql.org/docs/current/sql-grant.html) for more information.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: "Redshift Permissions"
---

## Example Redshift permissions

```
grant usage on database database_name to user_name;
grant create schema on database database_name to user_name;
grant usage on schema database.schema_name to user_name;
grant create table on schema database.schema_name to user_name;
grant create view on schema database.schema_name to user_name;
grant usage on all schemas in database database_name to user_name;
grant select on all tables in database database_name to user_name;
grant select on all views in database database_name to user_name;
```

Check out the [Official Documentation](https://docs.aws.amazon.com/redshift/latest/dg/r_GRANT.html) for more information.
18 changes: 18 additions & 0 deletions website/docs/reference/references-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,22 @@ Learn how to add more configurations to your dbt project or adapter, use propert
link="/reference/snowflake-permissions"
icon="computer"/>

<Card
title="Databricks Permissions Artifacts"
body="Provides an example Databricks database role permissions."
link="/reference/databricks-permissions"
icon="computer"/>

<Card
title="Redshift Permissions Artifacts"
body="Provides an example Redshift database role permissions."
link="/reference/redshift-permissions"
icon="computer"/>

<Card
title="Postgres Permissions Artifacts"
body="Provides an example Postgres database role permissions."
link="/reference/postgres-permissions"
icon="computer"/>

</div>
7 changes: 6 additions & 1 deletion website/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,12 @@ const sidebarSettings = {
{
type: "category",
label: "Database Permissions",
items: ["reference/snowflake-permissions"],
items: [
"reference/database-permissions/snowflake-permissions",
"reference/database-permissions/databricks-permissions",
"reference/database-permissions/redshift-permissions",
"reference/database-permissions/postgres-permissions",
],
},
],
guides: [
Expand Down

0 comments on commit 32396db

Please sign in to comment.