-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Remove RequiredPolicy #9399
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
Remove RequiredPolicy #9399
Changes from all commits
22ddd5c
5caacb6
3aab2a6
98c42f0
8e84cc9
b8485d2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,12 @@ public async Task Invoke(HttpContext context) | |
|
||
// IMPORTANT: Changes to authorization logic should be mirrored in MVC's AuthorizeFilter | ||
var authorizeData = endpoint?.Metadata.GetOrderedMetadata<IAuthorizeData>() ?? Array.Empty<IAuthorizeData>(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could just do |
||
if (authorizeData.Count() == 0) | ||
{ | ||
await _next(context); | ||
return; | ||
} | ||
|
||
var policy = await AuthorizationPolicy.CombineAsync(_policyProvider, authorizeData); | ||
if (policy == null) | ||
{ | ||
|
Uh oh!
There was an error while loading. Please reload this page.