How can I bypass or re-evaluate multi-tenancy for specific aggregates?
I have an aggregate for Count, but the problem is that it conflicts with the structure of the application when it comes to multi-tenancy. The relevant code looks like this: JsonAPI
As you can see, I’ve even changed the
read_action to :read_any, and that action itself bypasses multi-tenancy:
However, I’m still running into issues. One workaround I tried was using Ash.load! and explicitly setting the tenant, like so:
But that didn’t solve the problem either. When I don’t include the aggregate in the JSON response, everything works fine. But as soon as I include it, I get the following warning:
It seems like it’s still using the default read action internally, instead of the custom :read_any.
I can create calculate for it but how can fix my problem here in aggregates
Thank you in advanceSolution:Jump to solution
I don't believe that we have an option to bypass multitenancy for aggregates or calculations that use aggregates. You'll need to open an issue.
4 Replies
I even created a custom one
still it dose not let me
And i think it is about AshJsonAPI
Solution
I don't believe that we have an option to bypass multitenancy for aggregates or calculations that use aggregates. You'll need to open an issue.
Sorry Dear Zach, it is for Ash or AshJson?
to open issue
Ash core