Repository navigation
Close the open DELETE policy on forum_reactions - #256
Merged
Merged
Conversation
"Community delete reactions" (20260627) let anyone holding the anon key delete any reaction, so other people's likes could be wiped. It is no longer needed: inserting a reaction already requires a signed-in user with user_id = auth.uid(), and "Author delete reactions" covers the app's unlike path (toggleLike deletes the row found by the user's uid). Already applied to the live gamestringer-community project. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Drops the
"Community delete reactions"policy onpublic.forum_reactions(new migrationsupabase/migrations/20261126090000_close_reactions_delete.sql).Why
Migration
20260627added it (FOR DELETE TO public USING (user_id IS NOT NULL)) so anonymous community users could unlike. In practice anyone with the public anon key could delete any reaction and wipe other people's likes.It is no longer needed:
"Authenticated insert reactions"already requires a signed-in user withuser_id = auth.uid(), so anonymous users cannot like in the first place."Author delete reactions"(user_id = auth.uid()) covers the app's unlike path:toggleLikeinlib/social/forum.tsdeletes the row it found by the user's uid.Status
gamestringer-communityproject. The PR keeps the repo's migration history in sync.forum_reactionskeeps only the author DELETE, the authenticated INSERT and public SELECT. There is no UPDATE, DELETE or ALL policy left anywhere withUSING (true)orIS NOT NULL.tighten_update_policiesmigration from Harden the app, make String it reachable and undoable, cut dead code #253 applied. Before that, the live UPDATE/ALL policies were already owner-bound, so it re-created them explicitly and recorded the migration.🤖 Generated with Claude Code