feat(hasura): add role-based select_permissions for escrows and apart…#213
Conversation
…ments Closes safetrustcr#199 Answers the three open product questions from the issue: - Tenants browse all active (is_available=true, deleted_at IS NULL) apartments; landlords see only their own apartments including soft-deleted history. - Landlords see escrows via apartment.owner_id relationship (X-Hasura-User-Id); no new JWT claim needed on the landlord path. - Tenant escrow filter uses X-Hasura-User-Wallet (sender_address match); this claim is deferred to Batch N alongside the JWT migration that replaces x-hasura-admin-secret.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughRemoves ChangesLandlord column allowlist update for escrows
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
sotoJ24
left a comment
There was a problem hiding this comment.
Dear @Bosun-Josh121, please update you're current branch to merge it
|
@sotoJ24 you merged a PR addressing the same issue |
c046f1c to
be8852b
Compare
There was a problem hiding this comment.
Dear @Bosun-Josh121, I made some merge, sorry, could you update you're branch again please, everything else it's amazing, well done, good job
Summary
Closes #199
Adds
select_permissionsfortenantandlandlordroles onpublic.escrowsandpublic.apartments, following the patterns established inpublic_users.yamlandpublic_user_wallets.yaml.Decisions on open product questions
is_available = true AND deleted_at IS NULLapartment.owner_idorreceiver_address?apartment.owner_idrelationship , works with existingX-Hasura-User-Idsession variable, no new JWT claim neededdeleted_atexcluded from column list). Landlords: visible in their own history (deleted_atincluded in columns, no filter on it)Permission summary
public.apartmentsdeleted_atvisible?tenantis_available = true AND deleted_at IS NULLlandlordowner_id = X-Hasura-User-Idpublic.escrowsunsigned_xdrvisible?tenantsender_address = X-Hasura-User-Walletlandlordapartment.owner_id = X-Hasura-User-IdSummary by CodeRabbit