feat(hasura): add role-based select_permissions for escrows and apartments#206
Conversation
|
Warning Review limit reached
More reviews will be available in 53 minutes and 59 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more credits in the billing tab to continue. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughTwo Hasura metadata YAML files gain ChangesRole-based select permissions for apartments and escrows
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@infra/hasura/metadata/tenants/safetrust/databases/tables/public_escrows.yaml`:
- Around line 8-71: In the public_escrows.yaml file, the select_permissions for
both tenant and landlord roles are using incorrect Hasura v2 syntax for
column-to-column comparisons within _exists filters. Replace the _eq operators
with _ceq (column equal) operator and use the ["$", "column_name"] syntax for
root table column references. Specifically: in the tenant role's user_wallets
_exists filter, change wallet_address _eq sender_address to wallet_address _ceq
["$", "sender_address"]; in the landlord role's first user_wallets _exists
filter, change wallet_address _eq receiver_address to wallet_address _ceq ["$",
"receiver_address"]; and in the landlord role's apartments _exists filter,
change id _eq apartment_id to id _ceq ["$", "apartment_id"]. Keep the _eq
operators for X-Hasura-User-Id comparisons unchanged as those are variable
comparisons, not column comparisons.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 31762400-fd62-43b3-a8c9-a19c79d402fa
📒 Files selected for processing (2)
infra/hasura/metadata/tenants/safetrust/databases/tables/public_apartments.yamlinfra/hasura/metadata/tenants/safetrust/databases/tables/public_escrows.yaml
In Hasura v2 _exists._where filters, column-to-column comparisons require _ceq and ["$", "column"] syntax. Bare _eq treats the value as a literal string. Fixes three occurrences in tenant and landlord select_permissions for the escrows table.
Adds
select_permissionsfortenantandlandlordroles onapartmentsandescrowstables in the Hasura metadata.Apartments
Escrows
sender_address.receiver_addressOR they own the apartment via
apartment_id → owner_id.Uses
_exists._tableto correlate wallet addresses throughuser_walletswithout requiring a foreign key relationship.Blocked by — replacement of
x-hasura-admin-secretwith JWT role claims inapps/frontend/src/config/apollo.ts(Batch N).Closes #198
Summary by CodeRabbit