Ash FrameworkAF
Ash Framework3y ago
3 replies
djacobs7

Is there a plug for setting the tenant?

I am building an app where users can belong to different organizations. I want each organization to be it's own tenant ( https://hexdocs.pm/ash/multitenancy.html ). When the user is logged in, they select a tenant, and can only have access to data from that tenant.

Is there a way call set_tenant in a router plug ( similar to Ash.PlugHelpers.set_actor(user) ) so that I can globally set the current tenant, without for any queries that might need it?
Was this page helpful?