Master user token can not update/destroy a global false multi-tenancy resource
Hi sorry, I think have a mistake in using actions
Imagine you are a master user (has who has not
tenancy
) , now you want to update a a global false
multi-tenancy resource record!
So because it is master user
and has no tenancy
i created :get_any
action, my code set tenancy nil for master user on plug level
and inside router
but with master user
which his tenancy is nil , this patch
dose not allow me to touch update
action even, I mean before calling update
it returns something like this error
so it forces me to use generic action
, for example something like this https://gist.github.com/shahryarjb/f08e29615d5eed3b2ff2d9c87f314af1 to circumvent the problem
This is the way? or is there better way to do this?
Thank you in advance4 Replies
Can you not set a tenant when the global user goes to delete something?
Set it to the tenant of the thing that is being deleted?
You could use a header for example to set the tenant
i.e
x-tenant
Hi dear Zach
Can you not set a tenant when the global user goes to delete something?So the other parts are not global false (i mean global true) have problems. i have some resource global true some resource global false
You could use a header for example to set the tenantThe master user dose not know this resource for what
tenant
in api, so it should let me to read and set tenant to master user (the problem is , it prevents me to update
or destroy
function, before it return error, so i do not know the record side_id to set x-tenant
---
For making it clear
You are master user in the system so you can
- Change anything in any website
- Can create some global stuff to other tenant user to use (for example create global gallery component and let user use in website a, but the button of website b can not be used in a)Honestly multitenancy was not built with that in mind.
Solution
You'll have to use generic actions for a lot of things in that setup