Skip to content
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

Add auto_context_queryset_filter Meta field #49

Open
mbuvarp opened this issue Feb 9, 2021 · 1 comment
Open

Add auto_context_queryset_filter Meta field #49

mbuvarp opened this issue Feb 9, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@mbuvarp
Copy link
Collaborator

mbuvarp commented Feb 9, 2021

Would be nice having a field to restrict the available queryset for update and patch mutations based on context values. For example, say you have the field organization in the context. You could do something like this:

class PatchUserMutation(DjangoPatchMutation):
  class Meta:
    model = User
    auto_context_queryset_filter = {
      "organization": "organization"
    }

A user would then only be able to patch users in the same organization as them.

@mbuvarp mbuvarp added the enhancement New feature or request label Feb 9, 2021
@mbuvarp mbuvarp linked a pull request Feb 21, 2021 that will close this issue
@tOgg1 tOgg1 modified the milestones: v0.8.0, 0.9.0 Apr 22, 2021
@tOgg1 tOgg1 removed this from the v0.9.0 milestone Mar 13, 2022
@tOgg1
Copy link
Owner

tOgg1 commented Mar 13, 2022

After closer consideration, I am unsure whether or not this should actually be a part of the library. At some point, we'll end up putting our (this library's) hands in too much business logic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants