Skip to content

Changed to using AuthorizationPolicy#25

Merged
valdisiljuconoks merged 6 commits intomasterfrom
feature-auth-policy
Mar 17, 2026
Merged

Changed to using AuthorizationPolicy#25
valdisiljuconoks merged 6 commits intomasterfrom
feature-auth-policy

Conversation

@degborta
Copy link
Contributor

No description provided.

@gemini-code-assist
Copy link

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

degborta and others added 2 commits March 16, 2026 23:09
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>
@sonarqubecloud
Copy link

@valdisiljuconoks valdisiljuconoks merged commit f8259f8 into master Mar 17, 2026
3 checks passed
@valdisiljuconoks valdisiljuconoks deleted the feature-auth-policy branch March 17, 2026 08: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.

3 participants