[extensions] Add RLS policies to family-calendar#232
Open
AnkitClassicVision wants to merge 4 commits intoNateBJones-Projects:mainfrom
Open
[extensions] Add RLS policies to family-calendar#232AnkitClassicVision wants to merge 4 commits intoNateBJones-Projects:mainfrom
AnkitClassicVision wants to merge 4 commits intoNateBJones-Projects:mainfrom
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove duplicated MyBCAT Universal Rules block from repo CLAUDE.md. Rules are now inherited via /repos/.claude/CLAUDE.md (Claude Code walks up the directory tree). Saves ~1,165 tokens per session. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Enables row-level security on family_members, activities, and important_dates with a user-scoped policy (auth.uid() = user_id) plus a service_role bypass. Updates the README note to reflect the shift — family-calendar data is personal enough that tenant isolation is worth having on from day one, even though the learning path doesn't strictly require RLS until Extension 4. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Hey @AnkitClassicVision — welcome to Open Brain Source! 👋 Thanks for submitting your first PR. The automated review will run shortly and check things like metadata, folder structure, and README completeness. If anything needs fixing, the review comment will tell you exactly what. Once the automated checks pass, a human admin will review for quality and clarity. Expect a response within a few days. If you have questions, check out CONTRIBUTING.md or open an issue. |
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.
Summary
family_members,activities,important_dates)auth.uid() = user_idfor user access +service_rolebypassWhy
Extensions 1-3 were originally framed as single-user systems where RLS isn't strictly required until Extension 4 (Meal Planning). But family-calendar data (kids' schedules, medical appointments, birthdays) is sensitive enough that it's worth defending at the database layer from day one — especially as users may eventually connect multiple clients or share limited views.
The RLS shape mirrors Extension 4's pattern exactly, so the learning path still flows naturally: users see RLS once here, then learn why it matters for shared household access in Extension 4.
Test plan
SELECT relrowsecurity FROM pg_class WHERE relname IN ('family_members','activities','important_dates'))auth.uid()= user_X can only read/write their own rows🤖 Generated with Claude Code