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

Added the Authorize attribute to the methods whereby BusinessEntityIn… #1637

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

AndrD1406
Copy link
Contributor

Adding the Authorize attribute although HasPermission is derived from Authorize seems to be the only way to make the BusinessEntityInterceptor able to retrieve the UserId. Also added it to the Delete method because an unauthenticated user would never be able to delete an existing Workshop anyway (This method had the HasPermission as well so it seems to be right).

…terceptor wasn't able to get the currentUser
@AndrD1406 AndrD1406 self-assigned this Jan 20, 2025
@AndrD1406 AndrD1406 linked an issue Jan 20, 2025 that may be closed by this pull request
@github-actions github-actions bot requested a review from h4wk13 January 20, 2025 14:23
@@ -263,6 +263,7 @@ public async Task<IActionResult> GetByFilter([FromQuery] WorkshopFilter filter,
/// <response code="403">If the user has no rights to use this method, or sets some properties that are forbidden.</response>
/// <response code="500">If any server error occures.</response>
[HasPermission(Permissions.WorkshopAddNew)]
[Authorize]
Copy link
Contributor

Choose a reason for hiding this comment

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

can you double check that HasPermission does not work as authorize as it extends authorize? Maybe it is better to fix HasPermission instead of duplicating attributes

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.

BusinessEntityInterceptor can't retrieve User Id from HttpContext
2 participants