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

Make authorizer work for nested relations #355

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

jtomaszewski
Copy link

@jtomaszewski jtomaszewski commented Jan 31, 2025

Currently authorizer works more-or-less only one level down.

For example, if you have following entities:

  • TaskDTO
    • .subTasks (SubTaskDTO)
      • .subSubTasks (SubSubTaskDTO)

Then if you try to fetch tasks along with their sub-tasks and sub-sub-tasks; the authorizer of SubSubTaskDTO isn't used, nor is the relation.auth used which can be defined at SubTaskDTO level for the subSubTasks relation.

This PR fixes it - so that authorizers defined in nested DTOs are also called, if they exist.

P.S. For now this PR makes the fix only for read relations, but I can easily do it for update/remove relations resolvers too. @TriPSs just let me know if you're okay with the fix and be willing to merge this - then I'll finish the PR so it works for the other resolvers as well.

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

Successfully merging this pull request may close these issues.

1 participant