Skip to content

Commit dfdfe27

Browse files
docs: Fix SQL queries in realtime documentation (supabase#41519)
I'm relatively new to supabase, but in my current understanding the SQL selects are inconsistent with the given example schema as the column is named `room_topic` there. ## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. Yes. ## What kind of change does this PR introduce? Updates documentation. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **Documentation** * Corrected authorization policy examples in realtime guides to use accurate column references for topic-based access control in Broadcast and Presence features. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Chris Chinchilla <chris.ward@supabase.io>
1 parent e3eb51f commit dfdfe27

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

apps/docs/content/guides/realtime/authorization.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ exists (
133133
rooms_users
134134
where
135135
user_id = (select auth.uid())
136-
and topic = (select realtime.topic())
136+
and room_topic = (select realtime.topic())
137137
and realtime.messages.extension in ('broadcast')
138138
)
139139
);
@@ -266,7 +266,7 @@ with check (
266266
rooms_users
267267
where
268268
user_id = (select auth.uid())
269-
and topic = (select realtime.topic())
269+
and room_topic = (select realtime.topic())
270270
and realtime.messages.extension in ('broadcast')
271271
)
272272
);
@@ -293,7 +293,7 @@ using (
293293
rooms_users
294294
where
295295
user_id = (select auth.uid())
296-
and topic = (select realtime.topic())
296+
and room_topic = (select realtime.topic())
297297
and realtime.messages.extension in ('presence')
298298
)
299299
);
@@ -316,7 +316,7 @@ with check (
316316
rooms_users
317317
where
318318
user_id = (select auth.uid())
319-
and name = (select realtime.topic())
319+
and room_topic = (select realtime.topic())
320320
and realtime.messages.extension in ('presence')
321321
)
322322
);
@@ -343,7 +343,7 @@ using (
343343
rooms_users
344344
where
345345
user_id = (select auth.uid())
346-
and topic = (select realtime.topic())
346+
and room_topic = (select realtime.topic())
347347
and realtime.messages.extension in ('broadcast', 'presence')
348348
)
349349
);
@@ -366,7 +366,7 @@ with check (
366366
rooms_users
367367
where
368368
user_id = (select auth.uid())
369-
and name = (select realtime.topic())
369+
and room_topic = (select realtime.topic())
370370
and realtime.messages.extension in ('broadcast', 'presence')
371371
)
372372
);

0 commit comments

Comments
 (0)