mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-21 11:17:28 +08:00
#18995: Hiding Publish buttons if user doesn't have the expected permissions
Work Item: 18995 --HG-- branch : 1.x
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
<fieldset class="publish-button">
|
||||
@using Orchard.ContentManagement;
|
||||
@using Orchard.Core.Contents;
|
||||
@using Orchard.Utility.Extensions;
|
||||
|
||||
@if (Authorizer.Authorize(Permissions.PublishContent, (IContent)Model.ContentItem)) {
|
||||
<fieldset class="publish-button">
|
||||
<button type="submit" name="submit.Publish" value="submit.Publish">@T("Publish Now")</button>
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
}
|
@@ -1,6 +1,7 @@
|
||||
@using Orchard.ContentManagement;
|
||||
@using Orchard.Core.Contents
|
||||
@using Orchard.Core.Contents;
|
||||
@using Orchard.Utility.Extensions;
|
||||
|
||||
@{
|
||||
Script.Require("ShapesBase");
|
||||
ContentPart contentPart = Model.ContentPart;
|
||||
|
@@ -1,7 +1,15 @@
|
||||
@model Orchard.PublishLater.ViewModels.PublishLaterViewModel
|
||||
|
||||
@using Orchard.ContentManagement;
|
||||
@using Orchard.Core.Contents;
|
||||
@using Orchard.Utility.Extensions;
|
||||
|
||||
@{
|
||||
Style.Require("PublishLater_DatePicker");
|
||||
}
|
||||
|
||||
@if (Authorizer.Authorize(Permissions.PublishContent, Model.ContentItem)) {
|
||||
|
||||
<fieldset class="publish-later-datetime">
|
||||
<legend>@T("Publish")</legend>
|
||||
<label class="forpicker" for="@ViewData.TemplateInfo.GetFullHtmlFieldId("ScheduledPublishDate")">@T("Date")</label>
|
||||
@@ -10,7 +18,8 @@
|
||||
@Html.EditorFor(m => m.ScheduledPublishTime)
|
||||
<button type="submit" name="submit.Save" value="submit.PublishLater">@T("Publish Later")</button>
|
||||
</fieldset>
|
||||
@using(Script.Foot()) {
|
||||
|
||||
using (Script.Foot()) {
|
||||
|
||||
@* generates the localization script *@
|
||||
@Display(New.DatePickerLocalization())
|
||||
@@ -41,4 +50,6 @@
|
||||
})
|
||||
//]]>
|
||||
</script>
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user