Changed to using AuthorizationPolicy#25
Merged
valdisiljuconoks merged 6 commits intomasterfrom Mar 17, 2026
Merged
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
valdisiljuconoks
previously approved these changes
Mar 16, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR centralizes access control for the ContentTypeIcons controller by replacing the hard-coded role list on the controller action with a named authorization policy registered during service setup.
Changes:
- Added a new authorization policy constant and switched the controller to
[Authorize(Policy = ...)]. - Registered an authorization policy during
AddContentTypeIcons(...)and introduced an overload to allow customizing that policy. - Introduced a default policy based on the previously hard-coded role list.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Geta.Optimizely.ContentTypeIcons/Infrastructure/Configuration/ServiceCollectionExtensions.cs | Adds default/customizable authorization policy registration during service configuration. |
| src/Geta.Optimizely.ContentTypeIcons/Controllers/ContentTypeIconController.cs | Replaces role-based attribute with policy-based authorization. |
| src/Geta.Optimizely.ContentTypeIcons/Constants.cs | Adds a constant for the new authorization policy name. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...Geta.Optimizely.ContentTypeIcons/Infrastructure/Configuration/ServiceCollectionExtensions.cs
Outdated
Show resolved
Hide resolved
...Geta.Optimizely.ContentTypeIcons/Infrastructure/Configuration/ServiceCollectionExtensions.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
valdisiljuconoks
previously approved these changes
Mar 17, 2026
|
valdisiljuconoks
approved these changes
Mar 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



No description provided.