Skip to content

feat(docs): add docs on data api selective grants - #42046

Merged
ChrisChinchilla merged 3 commits into
masterfrom
charis/docs/public-grants
Jan 23, 2026
Merged

ChrisChinchilla merged 3 commits into
masterfrom
charis/docs/public-grants

Conversation

@charislam

@charislam charislam commented Jan 21, 2026 •

Copy link
Copy Markdown
Contributor

I have read the CONTRIBUTING.md file.

YES

What kind of change does this PR introduce?

Documentation update

What is the current behavior?

No documentation exists for Data API selective grants or the new Dashboard UI toggles for managing them.

What is the new behavior?

Add docs on selective grants for Data API, including the new Dashboard UI toggles. Also includes edits to the 42501 troubleshooting doc to help users when problems arise because of revoked grants.

Additional context

Resolves DOCS-666

Summary by CodeRabbit

  • Documentation
    • Expanded Data API security hardening guide: added sections on disabling the Data API, exposing a custom schema, automatically enabling RLS on new tables, and detailed table-level privilege management with admonitions and step-by-step Dashboard and SQL guidance.
    • Updated troubleshooting guide: refocused on "Missing table-level privileges," clearer diagnostics, concrete grant examples, and RLS-related security notes.

✏️ Tip: You can customize this high-level summary in your review settings.

Add docs on selective grants for Data API, including the new Dashboard
UI toggles. Also includes edits to the 42501 troubleshooting doc to help
users when problems arise because of revoked grants.
@vercel

vercel Bot commented Jan 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
docs Ready Ready Preview, Comment Jan 22, 2026 4:05pm
7 Skipped Deployments
Project Deployment Review Updated (UTC)
cms Ignored Ignored Jan 22, 2026 4:05pm
studio Ignored Ignored Jan 22, 2026 4:05pm
design-system Skipped Skipped Jan 22, 2026 4:05pm
studio-self-hosted Skipped Skipped Jan 22, 2026 4:05pm
studio-staging Skipped Skipped Jan 22, 2026 4:05pm
ui-library Skipped Skipped Jan 22, 2026 4:05pm
zone-www-dot-com Skipped Skipped Jan 22, 2026 4:05pm

Request Review

@supabase

supabase Bot commented Jan 21, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project xguihxuzqibwxjnimxev because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitai Bot commented Jan 21, 2026 •

Copy link
Copy Markdown
Contributor

Walkthrough

Updates documentation for the Data API security and troubleshooting: expands hardening guidance with RLS auto-enablement and table-level privilege controls, and revises 42501 troubleshooting to focus on diagnosing and granting table-level privileges with concrete SQL examples and security notes.

Changes

Cohort / File(s) Summary
Data API hardening guide
apps/docs/content/guides/database/hardening-data-api.mdx
Rewrote intro to cover multiple security controls; added sections for Disabling the Data API, Exposing a custom schema, Automatically enabling RLS on new tables, Table-level grants (dashboard + SQL examples), and related admonitions about RLS vs privileges.
42501 troubleshooting
apps/docs/content/troubleshooting/database-api-42501-errors.mdx
Renamed section to “Missing table-level privileges”; replaced object-level revocation guidance with table-privilege diagnostics (information_schema.role_table_grants), provided targeted GRANT examples (single-table and multi-privilege), and added admonition about enabling RLS and writing policies.

Suggested reviewers

  • samrose
  • soedirgo
  • CoolAssPuppy
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding documentation on Data API selective grants, which aligns with the primary content additions across both modified documentation files.
Description check ✅ Passed The description follows the template structure and includes all key sections: contributor confirmation, change type, current behavior explanation, new behavior description, and context with issue reference.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Jan 21, 2026
@charislam
charislam marked this pull request as ready for review January 21, 2026 19:20

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/docs/content/guides/database/hardening-data-api.mdx (1)

1-1: Fix Prettier formatting issues before merging.

The pipeline indicates code style issues were found in this file. Run Prettier to fix formatting:

npx prettier --write apps/docs/content/guides/database/hardening-data-api.mdx

@ChrisChinchilla ChrisChinchilla left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor formatting fixes

</Admonition>

1. Go to [**Table Editor**](/dashboard/project/_/editor) in the Supabase Dashboard.
1. Select the table you want to configure.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Select the table you want to configure.
2. Select the table you want to configure.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

markdown will automatically re-number these when they are rendered right? It could be good for maintainability to keep them all as 1.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will automatically re-number these

Yep, I personally prefer letting them auto-number (easier changes, no accidental misnumbering) but happy to follow any current formatting guidelines

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I admit I was always fussy about it, and here has been the first place I've seen so many come as "1", assuming everyone had some editor setting. It does render correctly, yes, ideally they would be correct for other non-rendered readers, such as machines (SEO, AI, etc), but it's minor, I may look to formalise it later, but i have generally been correcting them as I find them, which is also something we can automate. But all tools will treat them differently, too. tldr; I like to do markdown right, whatever that means…


1. Go to [**Table Editor**](/dashboard/project/_/editor) in the Supabase Dashboard.
1. Select the table you want to configure.
1. Click the vertical dots icon to open the table menu and select "Edit table".

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Click the vertical dots icon to open the table menu and select "Edit table".
3. Click the vertical dots icon to open the table menu and select "Edit table".

1. Go to [**Table Editor**](/dashboard/project/_/editor) in the Supabase Dashboard.
1. Select the table you want to configure.
1. Click the vertical dots icon to open the table menu and select "Edit table".
1. Under **Data API Access**, click the settings icon to open **Adjust API privileges per role**.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Under **Data API Access**, click the settings icon to open **Adjust API privileges per role**.
4. Under **Data API Access**, click the settings icon to open **Adjust API privileges per role**.

1. Select the table you want to configure.
1. Click the vertical dots icon to open the table menu and select "Edit table".
1. Under **Data API Access**, click the settings icon to open **Adjust API privileges per role**.
1. For each role (`anon` and `authenticated`), select or deselect the privileges you want to grant.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. For each role (`anon` and `authenticated`), select or deselect the privileges you want to grant.
5. For each role (`anon` and `authenticated`), select or deselect the privileges you want to grant.

1. Click the vertical dots icon to open the table menu and select "Edit table".
1. Under **Data API Access**, click the settings icon to open **Adjust API privileges per role**.
1. For each role (`anon` and `authenticated`), select or deselect the privileges you want to grant.
1. Click **Save**.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Click **Save**.
6. Click **Save**.

grant select, insert, update, delete on table public.your_table to anon, authenticated;
```

Note that granting privileges will allow access to your table through the Data API, so you should ensure you [enable RLS](/docs/guides/database/postgres/row-level-security) and write appropriate policies to protect your data.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Note that granting privileges will allow access to your table through the Data API, so you should ensure you [enable RLS](/docs/guides/database/postgres/row-level-security) and write appropriate policies to protect your data.
<Admonition type="note">
Granting privileges allows access to your table through the Data API, so you should ensure you [enable RLS](/docs/guides/database/postgres/row-level-security) and write appropriate policies to protect your data.


Note that granting privileges will allow access to your table through the Data API, so you should ensure you [enable RLS](/docs/guides/database/postgres/row-level-security) and write appropriate policies to protect your data.

For more information, see [Adjusting table-level privileges](/docs/guides/database/hardening-data-api#adjusting-table-level-privileges).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For more information, see [Adjusting table-level privileges](/docs/guides/database/hardening-data-api#adjusting-table-level-privileges).
For more information, see [Adjusting table-level privileges](/docs/guides/database/hardening-data-api#adjusting-table-level-privileges).
</Admonition>

</Admonition>

1. Go to [**Table Editor**](/dashboard/project/_/editor) in the Supabase Dashboard.
1. Select the table you want to configure.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

markdown will automatically re-number these when they are rendered right? It could be good for maintainability to keep them all as 1.


You can use an [event trigger](/docs/guides/database/postgres/event-triggers#example-trigger-function---auto-enable-row-level-security) to automatically enable RLS whenever a new table is created in the `public` schema. This ensures that no table is accidentally left exposed without RLS protection.

## Adjusting table-level privileges

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could just simplify to Table privileges or Table Grants?

@ChrisChinchilla
ChrisChinchilla merged commit c1cf23d into master Jan 23, 2026
13 checks passed
@ChrisChinchilla
ChrisChinchilla deleted the charis/docs/public-grants branch January 23, 2026 00:53
@github-actions

github-actions Bot commented Jan 23, 2026 •

Copy link
Copy Markdown
Contributor

Braintrust eval report

Assistant (master-1769129692)

Score Average Improvements Regressions
Completeness 100% (+0pp) - -
Conciseness 0% (+0pp) - -
Goal Completion 92.9% (+5pp) 1 🟢 1 🔴
Tool Usage 75% (+0pp) - -
Docs Faithfulness 62.5% (-12pp) - 1 🔴
Correctness 83.3% (-17pp) - 1 🔴
SQL Validity 100% (+0pp) - -
Time_to_first_token 0.2tok (-0.07tok) 7 🟢 1 🔴
Llm_calls 8 (-0.12) - 1 🔴
Tool_calls 2.63 (+0.13) 1 🟢 -
Errors 0 (+0) - -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 86872.5tok (-3744.5tok) 4 🟢 3 🔴
Prompt_cached_tokens 42016tok (-11392tok) 4 🟢 3 🔴
Prompt_cache_creation_tokens 0tok (+0tok) - -
Completion_tokens 5022tok (+214tok) 3 🟢 5 🔴
Completion_reasoning_tokens 3632tok (+176tok) 2 🟢 5 🔴
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 91894.5tok (-3530.5tok) 4 🟢 4 🔴
Estimated_cost 0.02$ (+0$) 3 🟢 5 🔴
Duration 34.71s (-16.33s) 4 🟢 4 🔴
Llm_duration 68.67s (-32.13s) 4 🟢 4 🔴

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autofix documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants