diff --git a/src/Orchard.Web/Modules/Orchard.Autoroute/Settings/AutorouteSettings.cs b/src/Orchard.Web/Modules/Orchard.Autoroute/Settings/AutorouteSettings.cs index 75bc1a033de..4c8291b0adb 100644 --- a/src/Orchard.Web/Modules/Orchard.Autoroute/Settings/AutorouteSettings.cs +++ b/src/Orchard.Web/Modules/Orchard.Autoroute/Settings/AutorouteSettings.cs @@ -18,6 +18,7 @@ public class AutorouteSettings { public AutorouteSettings() { PerItemConfiguration = false; AllowCustomPattern = true; + AllowSetAsHomePage = true; UseCulturePattern = false; AutomaticAdjustmentOnEdit = false; PatternDefinitions = "[]"; @@ -27,6 +28,7 @@ public AutorouteSettings() { public bool PerItemConfiguration { get; set; } public bool AllowCustomPattern { get; set; } + public bool AllowSetAsHomePage { get; set; } public bool UseCulturePattern { get; set; } public bool AutomaticAdjustmentOnEdit { get; set; } public bool? IsDefault { get; set; } @@ -100,6 +102,7 @@ public List DefaultPatterns { public void Build(ContentTypePartDefinitionBuilder builder) { builder.WithSetting("AutorouteSettings.PerItemConfiguration", PerItemConfiguration.ToString(CultureInfo.InvariantCulture)); builder.WithSetting("AutorouteSettings.AllowCustomPattern", AllowCustomPattern.ToString(CultureInfo.InvariantCulture)); + builder.WithSetting("AutorouteSettings.AllowSetAsHomePage", AllowSetAsHomePage.ToString(CultureInfo.InvariantCulture)); builder.WithSetting("AutorouteSettings.UseCulturePattern", UseCulturePattern.ToString(CultureInfo.InvariantCulture)); builder.WithSetting("AutorouteSettings.AutomaticAdjustmentOnEdit", AutomaticAdjustmentOnEdit.ToString(CultureInfo.InvariantCulture)); builder.WithSetting("AutorouteSettings.PatternDefinitions", PatternDefinitions); diff --git a/src/Orchard.Web/Modules/Orchard.Autoroute/Views/DefinitionTemplates/AutorouteSettings.cshtml b/src/Orchard.Web/Modules/Orchard.Autoroute/Views/DefinitionTemplates/AutorouteSettings.cshtml index ebc34592064..5f400d3886e 100644 --- a/src/Orchard.Web/Modules/Orchard.Autoroute/Views/DefinitionTemplates/AutorouteSettings.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Autoroute/Views/DefinitionTemplates/AutorouteSettings.cshtml @@ -15,7 +15,15 @@
@Html.CheckBoxFor(m => m.AllowCustomPattern) - @T("Allow the user to change the pattern on each item") + @T("Allow the user to change the pattern on each item.") +
+ +
+
+ @Html.CheckBoxFor(m => m.AllowSetAsHomePage) + + @T("Allow the user to set a content item of this type as the home page.") + @T("NOTE: Certain combinations of content type definitions and permission settings can create circumstances for non-Admin users with Dashboard access to remove the home page without the ability to set another one. Use this option with caution.")
diff --git a/src/Orchard.Web/Modules/Orchard.Autoroute/Views/EditorTemplates/Parts.Autoroute.Edit.cshtml b/src/Orchard.Web/Modules/Orchard.Autoroute/Views/EditorTemplates/Parts.Autoroute.Edit.cshtml index db6d9be356d..8e5d5f5ed16 100644 --- a/src/Orchard.Web/Modules/Orchard.Autoroute/Views/EditorTemplates/Parts.Autoroute.Edit.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Autoroute/Views/EditorTemplates/Parts.Autoroute.Edit.cshtml @@ -51,7 +51,7 @@
@if (!Model.IsHomePage) { - if (AuthorizedFor(Permissions.SetHomePage)) { + if (AuthorizedFor(Permissions.SetHomePage) && Model.Settings.AllowSetAsHomePage) {
@Html.CheckBoxFor(m => m.PromoteToHomePage)