> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paradime.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Model access

> Configure model access in dbt™️ to control visibility across projects and groups. Use access modifiers in dbt_project.yml or properties.yml. Define models as public or private to manage accessibility.

Some models are implementation details, meant for reference only within their group of related models. Other models should be accessible through the `ref` function across groups and projects. Models can set an [access modifier](https://en.wikipedia.org/wiki/Access_modifiers) to indicate their intended level of accessibility

### Configuring model access

You can apply access modifiers in config files, including the `dbt_project.yml`, or to models one-by-one in `properties.yml`. 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.

Use the `access` configuration to define the access level for a model. There are multiple approaches to configuring access.

<Tabs>
  <Tab title="properties.yml">
    ```yaml title="models/properties_my_public_model.yml" theme={"system"}
    version: 2

    # using the new method supported in v1.7
    models:
      - name: my_public_model
        config:
          access: public 

    # Older method, still supported

      - name: my_public_model_two
        access: public 
        
    ```
  </Tab>

  <Tab title="dbt_project.yml">
    ```yaml title="dbt_project.yml" theme={"system"}
    models:
      my_project_name:
        subfolder_name:
          +group: my_group
          +access: private  # sets default for all models in this subfolder
    ```
  </Tab>

  <Tab title="In-file">
    ```sql title="models/my_public_model.sql" theme={"system"}
    -- models/my_public_model.sql

    {{ config(access = "public") }}

    select ...
    ```
  </Tab>
</Tabs>

### Access level definition

The access level of the model you are declaring properties for.

| Access    | Referenceable by                                                                         |
| --------- | ---------------------------------------------------------------------------------------- |
| private   | Same group                                                                               |
| protected | Same project (or installed as a package)                                                 |
| public    | Any group, package, or project. When defined, rerun a production job to apply the change |

<Info>
  By default, all models are `protected`. This means that other models in the same project can reference them, regardless of their group.
</Info>

<Warning>
  Models with `materialized` set to `ephemeral` cannot have the access property set to public.
</Warning>


## Related topics

- [Model groups](/guides/data-mesh-setup/model-groups.md)
- [PII Anonymization with dbt™ Mesh Setup](/guides/pii-anonymization-with-dbt-tm-mesh-setup.md)
- [Data Mesh Setup](/guides/data-mesh-setup/index.md)
- [Security model](/resources/other-important-stuff/security-model.md)
- [Privacy model](/resources/other-important-stuff/privacy-model.md)
