{
  "source_file": "0930",
  "source_platform": "Ghost",
  "author": "Deep Learning Nerds",
  "title_listed": "Configuring dbt Model Access using Grants: A Practical Example",
  "keywords": "",
  "domain": "大模型算法",
  "content_type": "技术教程",
  "is_paid_flag": "否",
  "url": "https://www.deeplearningnerds.com/configuring-dbt-model-access-using-grants-practical-example/",
  "publish_date": "2026-06",
  "corpus_stage": "",
  "notes": "",
  "id": "24d6368e6a19",
  "collected_at": "2026-10-02T12:22:38",
  "title": "Configuring dbt Model Access using Grants: A Practical Example",
  "body_markdown": "📘 Introduction\nAccess control is an important part of every analytics project. Not every role should be able to query every model in your warehouse.\nWe use the same\ndlnerds_university\nMedallion Architecture example project from previous dbt posts, so the project structure stays familiar. In this tutorial, you will learn how to configure dbt model access with\ngrants\n.\nThe example is simple: the role\ndata_engineer\nshould be able to query all dbt models, the role\ndata_analyst\nshould only be able to query Gold models in\n03_gold\n, and the role\ndata_scientist\nshould only be able to query\ndim_student\n.\n💡 What are we implementing?\nWe will configure this access pattern:\ndata_engineer  -> Access to Silver and Gold models\ndata_analyst   -> Access only to Gold models\ndata_scientist -> Access only to dim_student\nIn our Medallion Architecture project, Bronze contains raw source table definitions in\nmodels/01_bronze/sources.yml\nand no dbt SQL models. Silver contains cleaned dbt models in\n02_silver\n. Gold contains business-ready dbt models in\n03_gold\n.\n💡\ndbt\ngrants\napply to dbt-created models, seeds, and snapshots. Raw source tables and schema-level permissions may still need separate warehouse permissions, depending on your data platform.\n✅ Prerequisites\n☑️ A working dbt project\n☑️ Raw source tables already loaded into the warehouse or local database\n☑️ Raw source tables already defined in\nmodels/01_bronze/sources.yml\n☑️ Existing Silver model\nstudent_cleaned\nwith its own YAML file\n☑️ Warehouse roles or grantees named\ndata_engineer\n,\ndata_analyst\n, and\ndata_scientist\n☑️ Permission to grant access on the target database objects\n🧱1️⃣ Understand the project structure\nFor this tutorial, we use this relevant excerpt of the\ndlnerds_university\nproject:\ndlnerds_university/\n├── dbt_project.yml\n└── models/\n    ├── 01_bronze/\n    │   └── sources.yml\n    ├── 02_silver/\n    │   ├── student_cleaned.sql\n    │   └── student_cleaned.yml\n    └── 03_gold/\n        ├── dim_student.sql\n        └── dim_student.yml\nThe important part is the model folder structure. We want a broad grant for all models and a more specific grant for the Gold folder.\n🔐2️⃣ Understand the access rule\nBefore writing dbt config, define the rule in plain English:\ndata_engineer\ngets\nselect\naccess on every dbt model in the project.\ndata_analyst\ngets\nselect\naccess only on models in\nmodels/03_gold\n.\ndata_scientist\ngets\nselect\naccess only on\ndim_student\n.\nSilver models stay hidden from analysts and data scientists, unless another warehouse permission gives them access.\nThis is a common pattern: engineers can inspect intermediate models, analysts consume business-ready Gold models, and a specialized role can access one specific model.\n🎓 Want to go deeper with dbt?\nIf you want to become confident with dbt project structure, access control, model configuration, and Medallion Architecture workflows, the Academy gives you more hands-on examples with real project patterns.\nIf you’d like to dive deeper into\ndbt (data build tool)\n, our book\nBuilding Modern Data Pipelines with dbt: From Raw Data to Gold Standard with the Medallion Architecture\nprovides a hands-on guide to designing modern data pipelines. It covers dbt’s core concepts and best practices, including building Bronze, Silver, and Gold layers with the\nMedallion Architecture\n. It also serves as a hands-on study guide for the\ndbt Analytics Engineering Certification\n.\nView on Amazon\nYou can view this post with the tier:\n      Academy Membership\nJoin academy now to read the post and get access to the full library of premium posts for academy members only.\nJoin Academy\nAlready have an account?\nSign In",
  "metadata": {
    "title": "Configuring dbt Model Access using Grants: A Practical Example",
    "description": "Learn how to configure dbt grants so data engineers can query all models, data analysts can query Gold models, and data scientists can query one specific model.",
    "keywords": null,
    "author": null,
    "og:site_name": "Deep Learning Nerds | The ultimate Learning Platform for AI and Data Science",
    "og:type": "article",
    "og:title": "Configuring dbt Model Access using Grants: A Practical Example",
    "og:description": "Learn how to configure dbt grants so data engineers can query all models, data analysts can query Gold models, and data scientists can query one specific model.",
    "og:url": "https://www.deeplearningnerds.com/configuring-dbt-model-access-using-grants-practical-example/",
    "og:image": "https://storage.ghost.io/c/5b/26/5b26e983-a59f-4f4b-a5f2-bd8c5a0a38e2/content/images/size/w1200/2026/06/dbt---Configuring-dbt-Model-Access-using-Grants-A-Practical-Example.png",
    "og:image:width": "1200",
    "og:image:height": "839",
    "twitter:card": "summary_large_image",
    "twitter:title": "Configuring dbt Model Access using Grants: A Practical Example",
    "twitter:description": "Learn how to configure dbt grants so data engineers can query all models, data analysts can query Gold models, and data scientists can query one specific model.",
    "twitter:url": "https://www.deeplearningnerds.com/configuring-dbt-model-access-using-grants-practical-example/",
    "twitter:image": "https://storage.ghost.io/c/5b/26/5b26e983-a59f-4f4b-a5f2-bd8c5a0a38e2/content/images/size/w1200/2026/06/dbt---Configuring-dbt-Model-Access-using-Grants-A-Practical-Example.png",
    "twitter:label1": "Written by",
    "twitter:data1": "Data Engineer",
    "twitter:label2": "Filed under",
    "twitter:data2": "dbt, Data Engineering, dbt Analytics Engineering Certification",
    "twitter:site": "@DLNerds",
    "article:published_time": "2026-06-05T12:48:08.000Z",
    "article:modified_time": "2026-06-05T12:48:08.000Z",
    "article:tag": "dbt Analytics Engineering Certification",
    "article:publisher": "https://www.facebook.com/deeplearningnerds/",
    "article:author": "https://www.facebook.com/deeplearningnerds/"
  },
  "paywall": {
    "listed_paid": false,
    "detected": false,
    "marker": "",
    "public_only": false,
    "policy": "付费/会员内容只保留页面公开可见部分，不绕过付费墙"
  },
  "crawl": {
    "success": true,
    "status_code": 200,
    "error": ""
  },
  "code_blocks": [
    {
      "file": "attachments/24d6368e6a19/code/body-000.txt",
      "chars": 140,
      "language": "text"
    },
    {
      "file": "attachments/24d6368e6a19/code/body-001.txt",
      "chars": 250,
      "language": "text"
    }
  ],
  "images": [
    {
      "status": "ok",
      "url": "https://storage.ghost.io/c/5b/26/5b26e983-a59f-4f4b-a5f2-bd8c5a0a38e2/content/images/2026/03/Mockup-Transparent-PNG-1.png",
      "bytes": 1130793,
      "reused": true,
      "local_path": "attachments/24d6368e6a19/images/005.png",
      "src": "https://storage.ghost.io/c/5b/26/5b26e983-a59f-4f4b-a5f2-bd8c5a0a38e2/content/images/2026/03/Mockup-Transparent-PNG-1.png",
      "alt": "CTA Image",
      "downloaded": true
    }
  ],
  "audio": [],
  "videos": [],
  "links": [
    {
      "href": "https://amzn.eu/d/04HPLJMo?ref=deeplearningnerds.com",
      "label": "",
      "type": "a"
    },
    {
      "href": "https://www.deeplearningnerds.com/membership/",
      "label": "Join Academy",
      "type": "a"
    },
    {
      "href": "https://www.deeplearningnerds.com/signin/",
      "label": "Sign In",
      "type": "a"
    }
  ],
  "repair_version": 2,
  "repaired_at": "2026-10-14T10:47:42Z",
  "source_url": "https://www.deeplearningnerds.com/configuring-dbt-model-access-using-grants-practical-example/",
  "papers": [],
  "actual_video_files": [],
  "body_chars": 3645,
  "expected_body_images": 1,
  "discovery_status": "ok",
  "delivery_status": "ok",
  "missing_reason": "",
  "raw_html": "attachments/24d6368e6a19/pages/source.html",
  "local_html": "attachments/24d6368e6a19/pages/article.html",
  "body_base_path": "attachments/24d6368e6a19/pages/",
  "body_markdown_path": "attachments/24d6368e6a19/pages/article.md"
}