Replies: 1 comment
-
What's wrong with the last code snippet you've posted? You should be able to access the role (Staff) of the ClaimsPrincipal as well as get the user Id from the ClaimsPrincipal, assuming you've put both of these on the ClaimsPrincipal, e.g. your token. Instead of doing the Validation inside of the resolver, you could also create a policy and handle it there: https://chillicream.com/docs/hotchocolate/security/authorization/#policies |
Beta Was this translation helpful? Give feedback.
-
Hey! I have a quick question about the authorization. Lets say I have:
And I want the LastName to be hidden if the requesting user isn't a staff member or the same user who there requesting. I thought of doing it like this:
However I can't figure it out. Any help would be appreciated. :)
Beta Was this translation helpful? Give feedback.
All reactions