Skip to content

Commit 5eda80d

Browse files
devshevathorwebdev
andauthored
docs(supabase): add warning section for RLS (#229)
* docs(supabase): add warning section for RLS * docs(supabase): add warning reasons about RLS * docs(supabase): add link to RLS Co-authored-by: Thor 雷神 Schaeff <5748289+thorwebdev@users.noreply.github.com> --------- Co-authored-by: Thor 雷神 Schaeff <5748289+thorwebdev@users.noreply.github.com>
1 parent e65c9a0 commit 5eda80d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/supabase/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,11 @@ create trigger handle_updated_at before update on YOUR_TABLE_NAME
9494
create trigger handle_updated_at before update on YOUR_TABLE_NAME
9595
for each row execute procedure moddatetime (updated_at);
9696
```
97+
98+
99+
## Notes (WARNING)
100+
101+
Using the `anon public` key will lead to unexpected behaviour since [RLS (Row Level Security)](https://supabase.com/docs/guides/database/postgres/row-level-security) is enabled by default when creating the table, and will lock writing unless explicit permissions.
102+
When RLS is enabled without configuration, a [default-deny policy](https://www.postgresql.org/docs/current/ddl-rowsecurity.html#DDL-ROWSECURITY:~:text=If%20no%20policy%20exists%20for%20the%20table%2C%20a%20default%2Ddeny%20policy%20is%20used%2C%20meaning%20that%20no%20rows%20are%20visible%20or%20can%20be%20modified) is used.
103+
104+
You can use `service_role` secret, but be aware that this will **bypass** RLS.

0 commit comments

Comments
 (0)