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

Refactor AuthZ Handler #105

Closed
wants to merge 1 commit into from
Closed

Conversation

zysim
Copy link
Collaborator

@zysim zysim commented Jun 11, 2022

Changes UserTypeAuthorizationHandler.cs to add the user role to the ClaimsPrincipal (controller context object) before evaluating authorisation. This means we can simply call HttpContext.User.HasClaim("role", UserTypes.<whatever>) in controller actions to get the already-authorised user's role.

@zysim zysim requested a review from a team as a code owner June 11, 2022 15:39
@zysim zysim self-assigned this Jun 11, 2022
@zysim zysim marked this pull request as draft June 11, 2022 15:39
@zysim
Copy link
Collaborator Author

zysim commented Jun 11, 2022

Setting this as a draft because it's based off of #100.

@zysim zysim marked this pull request as ready for review June 21, 2022 00:51
@zysim
Copy link
Collaborator Author

zysim commented Jul 27, 2023

Closing. Contains work affecting UserTypes, which should be deprecated in favour of using UserRole. However, the work is still relevant. Refer to #170 for the new task, and maybe use this PR as reference.

@zysim zysim closed this Jul 27, 2023
@zysim zysim deleted the AuthzRefactor branch August 21, 2023 06:16
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