-
-
Notifications
You must be signed in to change notification settings - Fork 332
Read Action multitenancy :bypass_all #2154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I like the idea, but I think we're going to have to do it with shared context. The tenant can be any value, so for all we know |
That makes sense |
- reading the tenancy configuration from the shared context - cascading the same configurations to the nested actions
β¦pdate, destroy and generic actions
| {:ok, %{query | tenant: nil, to_tenant: nil}} | ||
|
|
||
| :bypass_all -> | ||
| query = Ash.Query.set_context(query, %{shared: %{multitenancy: :bypass_all}}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using shared context means it will apply to all children, regardless of how deep they are nested. Is this the intent? IIRC you made a good point about it being less confusing if it only extends to direct relationships.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I think that was uncertain and you wanted this type of behavior. I think it can be confusing in both ways.
This pattern grew on me because it could be easier to debug knowing the all the descending queries will be untenanted instead of having to check each intermediate step. You know you users better so I'll leave the final decision to you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This way is better π
|
π Thank you for your contribution! π |
Always! |
This PR allows the user to setup a new value
bypass_allfor themultitenancyoption in the read action. Withbypass_allthe user can recursively bypass the tenancy of all the resources successively loaded.Also this PR removes the
bypassvalue from the other actions type since it wasn't actually implemented.Contributor checklist
Leave anything that you believe does not apply unchecked.