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?
3 Replies
Dirigible
Dirigible2y ago
Hi thanks for your question. The support forum in Discord has been archived. The place to get a response is on the Elixir forum here: https://elixirforum.com/c/elixir-framework-forums/ash-framework-forum/123 make sure that 'ash' is tagged in the post
Elixir Programming Language Forum
Ash Forum
Dirigible
Dirigible2y ago
I actually know the answer to this, so if you post over there I'll let you know! @ me when you done it.
djacobs7
djacobs7OP2y ago
Thanks. I just posted over there @Dirigible ( it said a mod needed to approve the post )

Did you find this page helpful?