mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 21:01:35 +08:00
#18748: Fixing BlogPost summary links permissions
The used shape was the generic content one. Now it uses a specific one which will ensure Blog permissions are used instead of dynamic one, which exist only for Creatable content types. Work Item: 18748 --HG-- branch : 1.x
This commit is contained in:
parent
5ca9b03741
commit
d31d6846c9
@ -173,6 +173,9 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="Views\Blog.DeleteButton.cshtml" />
|
<Content Include="Views\Blog.DeleteButton.cshtml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="Views\Content-BlogPost.SummaryAdmin.cshtml" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
|
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
|
@ -40,4 +40,7 @@
|
|||||||
<Place Parts_Blogs_Blog_Description="Content:before"/>
|
<Place Parts_Blogs_Blog_Description="Content:before"/>
|
||||||
</Match>
|
</Match>
|
||||||
</Match>
|
</Match>
|
||||||
|
<Match ContentType="BlogPost">
|
||||||
|
<Place Parts_Contents_Publish_SummaryAdmin="-"/>
|
||||||
|
</Match>
|
||||||
</Placement>
|
</Placement>
|
||||||
|
@ -0,0 +1,62 @@
|
|||||||
|
@using Orchard.ContentManagement;
|
||||||
|
@using Orchard.Core.Contents
|
||||||
|
@using Orchard.Utility.Extensions;
|
||||||
|
@{
|
||||||
|
Script.Require("ShapesBase");
|
||||||
|
ContentItem contentItem = Model.ContentItem;
|
||||||
|
var returnUrl = ViewContext.RequestContext.HttpContext.Request.ToUrlString();
|
||||||
|
}
|
||||||
|
<div class="summary" itemscope="itemscope" itemid="@contentItem.Id" itemtype="http://orchardproject.net/data/ContentItem">
|
||||||
|
<div class="properties">
|
||||||
|
<input type="checkbox" value="@contentItem.Id" name="itemIds"/>
|
||||||
|
<h3>@Html.ItemAdminLink(contentItem)</h3> - <div class="contentType">@contentItem.TypeDefinition.DisplayName</div>
|
||||||
|
@if (Model.Header != null) {
|
||||||
|
<div class="header">@Display(Model.Header)</div>
|
||||||
|
}
|
||||||
|
@if (Model.Meta != null) {
|
||||||
|
<div class="metadata">@Display(Model.Meta)</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
<div class="related">
|
||||||
|
@Display(Model.Actions)
|
||||||
|
|
||||||
|
@if (contentItem.HasPublished()) {
|
||||||
|
@Html.ItemDisplayLink(T("View").Text, contentItem)
|
||||||
|
@T(" | ")
|
||||||
|
|
||||||
|
if (contentItem.HasDraft()) {
|
||||||
|
@Html.Link(T("Publish Draft").Text, Url.Action("Publish", "Admin", new { area = "Contents", id = contentItem.Id, returnUrl = Request.ToUrlString() }), new { itemprop = "UnsafeUrl" })
|
||||||
|
@T(" | ")
|
||||||
|
|
||||||
|
if (Authorizer.Authorize(Orchard.Blogs.Permissions.PublishBlogPost, contentItem)) {
|
||||||
|
@Html.ActionLink(T("Preview").Text, "Preview", "Item", new { area = "Contents", id = contentItem.Id }, new { })
|
||||||
|
@T(" | ")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Authorizer.Authorize(Orchard.Blogs.Permissions.PublishBlogPost, contentItem)) {
|
||||||
|
@Html.Link(T("Unpublish").Text, Url.Action("Unpublish", "Admin", new { area = "Contents", id = contentItem.Id, returnUrl = Request.ToUrlString() }), new { itemprop = "UnsafeUrl" })
|
||||||
|
@T(" | ")
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (contentItem.HasDraft()) {
|
||||||
|
@Html.ActionLink(T("Preview").Text, "Preview", "Item", new { area = "Contents", id = contentItem.Id }, new { })
|
||||||
|
@T(" | ")
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Authorizer.Authorize(Orchard.Blogs.Permissions.PublishBlogPost, contentItem)) {
|
||||||
|
@Html.Link(T("Publish").Text, Url.Action("Publish", "Admin", new { area = "Contents", id = contentItem.Id, returnUrl = Request.ToUrlString() }), new { itemprop = "UnsafeUrl" })
|
||||||
|
@T(" | ")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@if (Authorizer.Authorize(Orchard.Blogs.Permissions.EditBlogPost, contentItem)) {
|
||||||
|
@Html.ItemEditLink(T("Edit").Text, contentItem)@T(" | ")
|
||||||
|
}
|
||||||
|
@if (Authorizer.Authorize(Orchard.Blogs.Permissions.DeleteBlogPost, contentItem)) {
|
||||||
|
@Html.Link(T("Delete").Text, Url.ItemRemoveUrl(contentItem, new {returnUrl}), new {itemprop = "RemoveUrl UnsafeUrl"})
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
@if (Model.Content != null) {
|
||||||
|
<div class="primary">@Display(Model.Content)</div>
|
||||||
|
}
|
||||||
|
</div>
|
Loading…
Reference in New Issue
Block a user