related Json api to load a resource which is not global multi-tendency when we have master user

Hi Sorry, i think it can not be supported and i should create custom action and call it in api json. but i just want to be sure about it
base_route "/v1/site/admin", MishkaCms.Runtime.Site do
related :error_pages, :read
end
base_route "/v1/site/admin", MishkaCms.Runtime.Site do
related :error_pages, :read
end
The scenario is as follows: - We have a master account for which we set multi-tenancy to nil at login. - Now, each error page is related to a specific tenancy. - So, the related router cannot automatically show error pages to the master user. - However, it can display them to non-master users because tenancy is not nil I think I cannot use related for this use case and instead need to call a custom action. Am I correct? Thanks in advance.
Solution:
You can add a special action for the read action that allows bypassing multitenancy and then only allow an admin user to do that.
Jump to solution
3 Replies
ZachDaniel
ZachDaniel2mo ago
Hm...so you're using attribute multitenancy?
Solution
ZachDaniel
ZachDaniel2mo ago
You can add a special action for the read action that allows bypassing multitenancy and then only allow an admin user to do that.
Shahryar
ShahryarOP2mo ago
multitenancy do
strategy :attribute
attribute :site_id
global? true
end
multitenancy do
strategy :attribute
attribute :site_id
global? true
end
Yes i did like this, create another action to do this. When a project has multitenancy some place global some place not, it makes huge complexity for managing data (in my opinion), it forces me to create extra action for api! for example some place read action has default behaviour when tenancy is set from plug Thank you

Did you find this page helpful?