It successfully reads the invitation (which belongs to the establishment tenant) thanks to
multitenancy :bypass
multitenancy :bypass
However, loading inviter (an establishment_user) requires a tenant to be set, and establishment returns nil — I’m guessing because the policy doesn’t allow reading establishment data unless you’re a member, which we aren’t here (yet).
This means we never even reach organization (top-level tenant).
How can I bypass tenancy & authorization policies just for this exceptional case so I can load related data (inviter, establishment, organization)?
The Elixir backend framework for unparalleled productivity. Declarative tools that let you stop wasting time. Use with Phoenix LiveView or build APIs in minutes for your front-end of choice.