Require delete permission for blog posts#25207
Merged
yagmurcelk merged 1 commit intorel-10.2from Apr 3, 2026
Merged
Conversation
Remove the ownership-based fallback that allowed post creators to delete their own posts in Detail.cshtml. Deletion now strictly requires BloggingPermissions.Posts.Delete, centralizing authorization on explicit permissions to enforce consistent access control.
Contributor
There was a problem hiding this comment.
Pull request overview
Tightens blog post deletion UI authorization by removing the “creator can delete own post” fallback and showing the Delete action only when the explicit delete permission is granted.
Changes:
- Updated the post detail page to render the Delete link only when
BloggingPermissions.Posts.Deleteis granted.
Comments suppressed due to low confidence (1)
modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml:102
- The UI now hides the Delete link unless
BloggingPermissions.Posts.Deleteis granted, but the backend authorization policy still has an ownership-based fallback for delete (PostAuthorizationHandler.HasDeletePermissionreturns true for the creator). This means deletion is not strictly permission-based as described, and any code path that relies onCommonOperations.Deletewithout the[Authorize(BloggingPermissions.Posts.Delete)]attribute would still allow creators to delete. Consider removing the creator/owner fallback for delete inPostAuthorizationHandler(and ensure update/delete policies align with the intended permission model).
@if (await Authorization.IsGrantedAsync(BloggingPermissions.Posts.Delete))
{
<span class="seperator">|</span>
<a href="#" id="DeletePostLink" data-postid="@Model.Post.Id" data-blogShortName="@Model.BlogShortName">
<i class="fa fa-trash"></i> @L["Delete"]
Contributor
|
Once the release for version 10.2 comes out, it will be tested live. |
yagmurcelk
approved these changes
Apr 3, 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.
Description
Remove the ownership-based fallback that allowed post creators to delete their own posts in Detail.cshtml. Deletion now strictly requires BloggingPermissions.Posts.Delete, centralizing authorization on explicit permissions to enforce consistent access control.
Resolves vs-internal-issue-#8299
Checklist