-
Notifications
You must be signed in to change notification settings - Fork 947
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## What are you changing in this pull request and why? Adding to the access page per #4075 Also moving the page to the resource configs files ## Checklist - [x] Add versioning components, as described in [Versioning Docs](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#versioning-entire-pages) - [x] Review the [Content style guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md) and [About versioning](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#adding-a-new-version) so my content adheres to these guidelines. - [x] Add a checklist item for anything that needs to happen before this PR is merged, such as "needs technical review" or "change base branch." Adding new pages (delete if not applicable): - [x] Add page to `website/sidebars.js` - [x] Provide a unique filename for the new page Removing or renaming existing pages (delete if not applicable): - [x] Remove page from `website/sidebars.js` - [x] Add an entry `website/static/_redirects` - [x] [Ran link testing](https://github.com/dbt-labs/docs.getdbt.com#running-the-cypress-tests-locally) to update the links that point to the deleted page
- Loading branch information
Showing
8 changed files
with
109 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
--- | ||
resource_types: [models] | ||
datatype: access | ||
--- | ||
|
||
<File name='models/<schema>.yml'> | ||
|
||
```yml | ||
version: 2 | ||
|
||
models: | ||
- name: model_name | ||
access: private | protected | public | ||
``` | ||
</File> | ||
<VersionBlock lastVersion="1.6"> | ||
Access modifiers may be applied to models one-by-one in YAML properties. In v1.5 and v1.6, you are unable to configure `access` for multiple models at once. Upgrade to v1.7 for additional configuration options. A group or subfolder contains models with varying access levels, so when you designate a model with `access: public`, make sure you intend for this behavior. | ||
|
||
</VersionBlock> | ||
|
||
<VersionBlock firstVersion="1.7"> | ||
|
||
You can apply access modifiers in config files, including `the dbt_project.yml`, or to models one-by-one in YAML properties. Applying access configs to a subfolder modifies the default for all models in that subfolder, so make sure you intend for this behavior. When setting individual model access, a group or subfolder might contain a variety of access levels, so when you designate a model with `access: public` make sure you intend for this behavior. | ||
|
||
There are multiple approaches to configuring access: | ||
|
||
In the model configs of `dbt_project.yml``: | ||
|
||
```yaml | ||
models: | ||
- name: my_public_model | ||
access: public # Older method, still supported | ||
``` | ||
Or (but not both) | ||
|
||
```yaml | ||
models: | ||
- name: my_public_model | ||
config: | ||
access: public # newly supported in v1.7 | ||
``` | ||
|
||
In a subfolder: | ||
```yaml | ||
models: | ||
my_project_name: | ||
subfolder_name: | ||
+group: <my_group> | ||
+access: private # sets default for all models in this subfolder | ||
``` | ||
|
||
In the model.sql file: | ||
|
||
```sql | ||
-- models/my_public_model.sql | ||
{{ config(access = "public") }} | ||
select ... | ||
``` | ||
|
||
</VersionBlock> | ||
|
||
## Definition | ||
The access level of the model you are declaring properties for. | ||
|
||
Some models (not all) are designed to be referenced through the [ref](/reference/dbt-jinja-functions/ref) function across [groups](/docs/build/groups). | ||
|
||
| Access | Referenceable by | | ||
|-----------|-------------------------------| | ||
| private | same group | | ||
| protected | same project/package | | ||
| public | any group, package or project | | ||
|
||
If you try to reference a model outside of its supported access, you will see an error: | ||
|
||
```shell | ||
dbt run -s marketing_model | ||
... | ||
dbt.exceptions.DbtReferenceError: Parsing Error | ||
Node model.jaffle_shop.marketing_model attempted to reference node model.jaffle_shop.finance_model, | ||
which is not allowed because the referenced node is private to the finance group. | ||
``` | ||
|
||
## Default | ||
|
||
By default, all models are "protected." This means that other models in the same project can reference them. | ||
|
||
## Related docs | ||
|
||
* [Model Access](/docs/collaborate/govern/model-access#groups) | ||
* [Group configuration](/reference/resource-configs/group) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters