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

OCC-67: Add OrderPart permissions #318

Merged
merged 5 commits into from
Jul 25, 2023
Merged

OCC-67: Add OrderPart permissions #318

merged 5 commits into from
Jul 25, 2023

Conversation

porgabi
Copy link
Contributor

@porgabi porgabi commented Jul 24, 2023

OCC-67

Fixes #115

@porgabi porgabi marked this pull request as ready for review July 24, 2023 12:30
// Regular users should only see their own Orders, while users with the ManageOrders permission should be
// able to see all Orders.
if (!await _authorizationServiceLazy.Value.AuthorizeAsync(context.User, Permissions.ManageOrders) &&
context.User.Identity.Name != order.ContentItem.Author)
Copy link
Contributor

Choose a reason for hiding this comment

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

Identitiy? should be used here as it is a nullable type and can lead to an exception.

context.Fail();
}

return;
Copy link
Contributor

Choose a reason for hiding this comment

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

This return here is redundant.

@Psichorex Psichorex merged commit 837ba9c into main Jul 25, 2023
6 checks passed
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.

Add OrderPart permissions (OCC-67)
2 participants