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

fix: make sure generic actions are authorized #100

Merged
merged 1 commit into from
Nov 24, 2023

Conversation

barnabasJ
Copy link
Contributor

@barnabasJ barnabasJ commented Nov 24, 2023

Contributor checklist

  • Bug fixes include regression tests
  • Features include unit/acceptance tests

@barnabasJ barnabasJ self-assigned this Nov 24, 2023
@barnabasJ barnabasJ added the bug Something isn't working label Nov 24, 2023
authorize?: AshGraphql.Api.Info.authorize?(api),
tenant: Map.get(context, :tenant)
]

result =
%Ash.ActionInput{api: api, resource: resource}
|> Ash.ActionInput.set_context(get_context(context))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused about this because it seems like context is already the context, and those values are never attached to the action.

This looks for another nested context or ash_context inside the context. This is also done in all the other resolvers, and it seems like the actor is only set in the context because of the opts. Not sure if I'm missing something there?

Copy link
Contributor Author

@barnabasJ barnabasJ Nov 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think everything is working for now. I just wanted to make sure I understood this.

@zachdaniel zachdaniel merged commit b9a3051 into main Nov 24, 2023
13 checks passed
@zachdaniel
Copy link
Contributor

🚀 Thank you for your contribution! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants