© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3y ago•
2 replies
Mr Void

Realtime event is sent to user, even though policy is set

I have a table:
collection_share
collection_share
which has a field called
shared_with
shared_with
, containing a user's UUID.
+------------------------------------------------------------+
| share_collection                                           |
+------------------+---------------+-------------+-----------+
| id               | collection_id | shared_with | author_id |
| 123              | 12345         | cf756...    | a1c31b... |
+------------------+---------------+-------------+-----------+
+------------------------------------------------------------+
| share_collection                                           |
+------------------+---------------+-------------+-----------+
| id               | collection_id | shared_with | author_id |
| 123              | 12345         | cf756...    | a1c31b... |
+------------------+---------------+-------------+-----------+


Whenever a new row is added to this table, a realtime event is fired and broadcasted to ALL users even tho the policy for reading from this table is set to
auth.uid() == shared_with
auth.uid() == shared_with


For example, user1 has uid
cf756...
cf756...
( this user should receive the event )
BUT another user with uid e.g
b42cj...
b42cj...
also receives this event, why?

How can I only allow user's with matching
auth.uid() == shared_with
auth.uid() == shared_with
to receive the event?
image.png
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Storage Policy - User Access to File
SupabaseSSupabase / help-and-questions
4y ago
Realtime event with complex query
SupabaseSSupabase / help-and-questions
3y ago
Policy to check user belongs to team
SupabaseSSupabase / help-and-questions
4y ago
[SOLVED] set update policy to update fields
SupabaseSSupabase / help-and-questions
5d ago