From bf55ef6b752e91bd7c655049a049e44cd9f6de11 Mon Sep 17 00:00:00 2001 From: Mike Alhayek Date: Thu, 7 Mar 2024 09:34:34 -0800 Subject: [PATCH 1/6] Add a way to hide ContentTypeDefinitionSettings --- .../ContentTypeSettingsDisplayDriver.cs | 63 +++++++++++++--- .../ContentTypeSettingsViewModel.cs | 12 +++ .../Views/ContentTypeSettings.Edit.cshtml | 75 +++++++++++-------- .../OrchardCore.CustomSettings/Startup.cs | 6 ++ .../OrchardCore.Users/Startup.cs | 6 ++ .../ContentTypeDefinitionDriverOptions.cs | 23 ++++++ .../Models/ContentTypeDefinitionOptions.cs | 10 +++ 7 files changed, 155 insertions(+), 40 deletions(-) create mode 100644 src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Models/ContentTypeDefinitionDriverOptions.cs create mode 100644 src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Models/ContentTypeDefinitionOptions.cs diff --git a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Editors/ContentTypeSettingsDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Editors/ContentTypeSettingsDisplayDriver.cs index 59b19eafbed..e9b7a56eaf1 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Editors/ContentTypeSettingsDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Editors/ContentTypeSettingsDisplayDriver.cs @@ -1,6 +1,8 @@ +using System; using System.Linq; using System.Threading.Tasks; using Microsoft.Extensions.Localization; +using Microsoft.Extensions.Options; using OrchardCore.ContentManagement.Metadata.Models; using OrchardCore.ContentManagement.Metadata.Settings; using OrchardCore.ContentTypes.ViewModels; @@ -10,16 +12,22 @@ namespace OrchardCore.ContentTypes.Editors { public class ContentTypeSettingsDisplayDriver : ContentTypeDefinitionDisplayDriver { + private static readonly ContentTypeDefinitionDriverOptions _defaultOptions = new(); + protected readonly IStringLocalizer S; + private readonly ContentTypeDefinitionOptions _options; - public ContentTypeSettingsDisplayDriver(IStringLocalizer stringLocalizer) + public ContentTypeSettingsDisplayDriver( + IStringLocalizer stringLocalizer, + IOptions options) { S = stringLocalizer; + _options = options.Value; } public override IDisplayResult Edit(ContentTypeDefinition contentTypeDefinition) { - return Initialize("ContentTypeSettings_Edit", model => + return Initialize("ContentTypeSettings_Edit", (Action)(model => { var settings = contentTypeDefinition.GetSettings(); @@ -30,7 +38,9 @@ public override IDisplayResult Edit(ContentTypeDefinition contentTypeDefinition) model.Securable = settings.Securable; model.Stereotype = settings.Stereotype; model.Description = settings.Description; - }).Location("Content:5"); + model.Options = GetOptions(contentTypeDefinition, settings.Stereotype); + + })).Location("Content:5"); } public override async Task UpdateAsync(ContentTypeDefinition contentTypeDefinition, UpdateTypeEditorContext context) @@ -39,25 +49,58 @@ public override async Task UpdateAsync(ContentTypeDefinition con if (await context.Updater.TryUpdateModelAsync(model, Prefix)) { - context.Builder.Creatable(model.Creatable); - context.Builder.Listable(model.Listable); - context.Builder.Draftable(model.Draftable); - context.Builder.Versionable(model.Versionable); - context.Builder.Securable(model.Securable); - context.Builder.WithDescription(model.Description); - var stereotype = model.Stereotype?.Trim(); + context.Builder.WithDescription(model.Description); context.Builder.Stereotype(stereotype); if (!IsAlphaNumericOrEmpty(stereotype)) { context.Updater.ModelState.AddModelError(nameof(ContentTypeSettingsViewModel.Stereotype), S["The stereotype should be alphanumeric."]); } + + var options = GetOptions(contentTypeDefinition, stereotype); + + Apply(context, model, options); } return Edit(contentTypeDefinition); } + private static void Apply(UpdateTypeEditorContext context, ContentTypeSettingsViewModel model, ContentTypeDefinitionDriverOptions options) + { + if (options.ShowVersionable) + { + context.Builder.Versionable(model.Versionable); + } + if (options.ShowCreatable) + { + context.Builder.Creatable(model.Creatable); + } + if (options.ShowSecurable) + { + context.Builder.Securable(model.Securable); + } + if (options.ShowListable) + { + context.Builder.Listable(model.Listable); + } + } + + private ContentTypeDefinitionDriverOptions GetOptions(ContentTypeDefinition contentTypeDefinition, string sterotype) + { + if (sterotype != null && _options.Stereotypes.TryGetValue(sterotype, out var stereotypesOptions)) + { + return stereotypesOptions; + } + + if (contentTypeDefinition.Name != null && _options.Stereotypes.TryGetValue(contentTypeDefinition.Name, out var typeOptions)) + { + return typeOptions; + } + + return _defaultOptions; + } + private static bool IsAlphaNumericOrEmpty(string value) { if (string.IsNullOrEmpty(value)) diff --git a/src/OrchardCore.Modules/OrchardCore.ContentTypes/ViewModels/ContentTypeSettingsViewModel.cs b/src/OrchardCore.Modules/OrchardCore.ContentTypes/ViewModels/ContentTypeSettingsViewModel.cs index 3d6d146be45..3081711a4d7 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentTypes/ViewModels/ContentTypeSettingsViewModel.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentTypes/ViewModels/ContentTypeSettingsViewModel.cs @@ -1,13 +1,25 @@ +using Microsoft.AspNetCore.Mvc.ModelBinding; +using OrchardCore.ContentManagement.Metadata.Models; + namespace OrchardCore.ContentTypes.ViewModels { public class ContentTypeSettingsViewModel { public bool Creatable { get; set; } + public bool Listable { get; set; } + public bool Draftable { get; set; } + public bool Versionable { get; set; } + public bool Securable { get; set; } + public string Stereotype { get; set; } + public string Description { get; set; } + + [BindNever] + public ContentTypeDefinitionDriverOptions Options { get; set; } } } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Views/ContentTypeSettings.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Views/ContentTypeSettings.Edit.cshtml index 969f695fa29..e79dab08f65 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Views/ContentTypeSettings.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Views/ContentTypeSettings.Edit.cshtml @@ -8,45 +8,60 @@ @T["(Optional) Description of the content type"] -
-
- - - @T["Determines if an instance of this content type can be created through the UI."] +@if (Model.Options.ShowCreatable) +{ +
+
+ + + @T["Determines if an instance of this content type can be created through the UI."] +
-
+} -
-
- - - @T["Determines if an instance of this content type can be listed through the UI."] +@if (Model.Options.ShowListable) +{ +
+
+ + + @T["Determines if an instance of this content type can be listed through the UI."] +
-
+} -
-
- - - @T["Determines if this content type supports draft versions."] +@if (Model.Options.ShowDraftable) +{ +
+
+ + + @T["Determines if this content type supports draft versions."] +
-
+} -
-
- - - @T["Determines if this content type supports versioning."] +@if (Model.Options.ShowVersionable) +{ +
+
+ + + @T["Determines if this content type supports versioning."] +
-
+} -
-
- - - @T["Determines if this content type can have custom permissions."] +@if (Model.Options.ShowSecurable) +{ +
+
+ + + @T["Determines if this content type can have custom permissions."] +
-
+}
diff --git a/src/OrchardCore.Modules/OrchardCore.CustomSettings/Startup.cs b/src/OrchardCore.Modules/OrchardCore.CustomSettings/Startup.cs index df5eeaf294f..53ed2ff6e65 100644 --- a/src/OrchardCore.Modules/OrchardCore.CustomSettings/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.CustomSettings/Startup.cs @@ -1,5 +1,6 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.Extensions.DependencyInjection; +using OrchardCore.ContentManagement.Metadata.Models; using OrchardCore.CustomSettings.Deployment; using OrchardCore.CustomSettings.Drivers; using OrchardCore.CustomSettings.Recipes; @@ -27,6 +28,11 @@ public override void ConfigureServices(IServiceCollection services) services.AddScoped(); services.AddRecipeExecutionStep(); + + services.Configure(options => + { + options.Stereotypes.TryAdd("CustomSettings", new ContentTypeDefinitionDriverOptions(false)); + }); } } diff --git a/src/OrchardCore.Modules/OrchardCore.Users/Startup.cs b/src/OrchardCore.Modules/OrchardCore.Users/Startup.cs index dcaff32d83a..d165b379ecd 100644 --- a/src/OrchardCore.Modules/OrchardCore.Users/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.Users/Startup.cs @@ -14,6 +14,7 @@ using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Options; using OrchardCore.Admin.Models; +using OrchardCore.ContentManagement.Metadata.Models; using OrchardCore.Data; using OrchardCore.Data.Migration; using OrchardCore.Deployment; @@ -459,6 +460,11 @@ public override void ConfigureServices(IServiceCollection services) services.AddScoped, CustomUserSettingsDisplayDriver>(); services.AddScoped(); services.AddDeployment(); + + services.Configure(options => + { + options.Stereotypes.TryAdd("CustomUserSettings", new ContentTypeDefinitionDriverOptions(false)); + }); } } diff --git a/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Models/ContentTypeDefinitionDriverOptions.cs b/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Models/ContentTypeDefinitionDriverOptions.cs new file mode 100644 index 00000000000..84c582d46a3 --- /dev/null +++ b/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Models/ContentTypeDefinitionDriverOptions.cs @@ -0,0 +1,23 @@ +namespace OrchardCore.ContentManagement.Metadata.Models; + +public class ContentTypeDefinitionDriverOptions +{ + public bool ShowCreatable { get; set; } + + public bool ShowListable { get; set; } + + public bool ShowDraftable { get; set; } + + public bool ShowVersionable { get; set; } + + public bool ShowSecurable { get; set; } + + public ContentTypeDefinitionDriverOptions(bool defaultValue = true) + { + ShowCreatable = defaultValue; + ShowListable = defaultValue; + ShowDraftable = defaultValue; + ShowVersionable = defaultValue; + ShowSecurable = defaultValue; + } +} diff --git a/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Models/ContentTypeDefinitionOptions.cs b/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Models/ContentTypeDefinitionOptions.cs new file mode 100644 index 00000000000..0be16e366a0 --- /dev/null +++ b/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Models/ContentTypeDefinitionOptions.cs @@ -0,0 +1,10 @@ +using System.Collections.Generic; + +namespace OrchardCore.ContentManagement.Metadata.Models; + +public class ContentTypeDefinitionOptions +{ + public Dictionary Stereotypes { get; } = []; + + public Dictionary ContentTypes { get; } = []; +} From 5fa86ff8de0c1f35cfa59dc18ea37a28a2821b50 Mon Sep 17 00:00:00 2001 From: Mike Alhayek Date: Fri, 22 Mar 2024 17:00:10 -0700 Subject: [PATCH 2/6] Update src/OrchardCore.Modules/OrchardCore.ContentTypes/Editors/ContentTypeSettingsDisplayDriver.cs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Zoltán Lehóczky --- .../Editors/ContentTypeSettingsDisplayDriver.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Editors/ContentTypeSettingsDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Editors/ContentTypeSettingsDisplayDriver.cs index e9b7a56eaf1..3a1b8ea9aac 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Editors/ContentTypeSettingsDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Editors/ContentTypeSettingsDisplayDriver.cs @@ -72,14 +72,17 @@ private static void Apply(UpdateTypeEditorContext context, ContentTypeSettingsVi { context.Builder.Versionable(model.Versionable); } + if (options.ShowCreatable) { context.Builder.Creatable(model.Creatable); } + if (options.ShowSecurable) { context.Builder.Securable(model.Securable); } + if (options.ShowListable) { context.Builder.Listable(model.Listable); From 5dc17f66adbcef8b8b754229d4a8cfcf9d4943a8 Mon Sep 17 00:00:00 2001 From: Mike Alhayek Date: Fri, 22 Mar 2024 17:00:58 -0700 Subject: [PATCH 3/6] Update src/OrchardCore.Modules/OrchardCore.ContentTypes/Editors/ContentTypeSettingsDisplayDriver.cs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Zoltán Lehóczky --- .../Editors/ContentTypeSettingsDisplayDriver.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Editors/ContentTypeSettingsDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Editors/ContentTypeSettingsDisplayDriver.cs index 3a1b8ea9aac..4fe875d9161 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Editors/ContentTypeSettingsDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Editors/ContentTypeSettingsDisplayDriver.cs @@ -89,7 +89,7 @@ private static void Apply(UpdateTypeEditorContext context, ContentTypeSettingsVi } } - private ContentTypeDefinitionDriverOptions GetOptions(ContentTypeDefinition contentTypeDefinition, string sterotype) + private ContentTypeDefinitionDriverOptions GetOptions(ContentTypeDefinition contentTypeDefinition, string stereotype) { if (sterotype != null && _options.Stereotypes.TryGetValue(sterotype, out var stereotypesOptions)) { From b2ed9fba7f5e913f0a79aeb0300392c5017684b8 Mon Sep 17 00:00:00 2001 From: Mike Alhayek Date: Fri, 22 Mar 2024 17:01:09 -0700 Subject: [PATCH 4/6] Update src/OrchardCore.Modules/OrchardCore.ContentTypes/Editors/ContentTypeSettingsDisplayDriver.cs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Zoltán Lehóczky --- .../Editors/ContentTypeSettingsDisplayDriver.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Editors/ContentTypeSettingsDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Editors/ContentTypeSettingsDisplayDriver.cs index 4fe875d9161..6e9b53f2a55 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Editors/ContentTypeSettingsDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Editors/ContentTypeSettingsDisplayDriver.cs @@ -96,7 +96,7 @@ private ContentTypeDefinitionDriverOptions GetOptions(ContentTypeDefinition cont return stereotypesOptions; } - if (contentTypeDefinition.Name != null && _options.Stereotypes.TryGetValue(contentTypeDefinition.Name, out var typeOptions)) + if (contentTypeDefinition.Name != null && _options.ContentTypes.TryGetValue(contentTypeDefinition.Name, out var typeOptions)) { return typeOptions; } From 1b350134ef37c4f2005d12f88dcb594704478c13 Mon Sep 17 00:00:00 2001 From: Mike Alhayek Date: Fri, 22 Mar 2024 17:43:08 -0700 Subject: [PATCH 5/6] fix build --- .../ContentTypeSettingsDisplayDriver.cs | 27 +++++++++---------- .../Models/ContentTypeDefinitionOptions.cs | 11 ++++++++ 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Editors/ContentTypeSettingsDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Editors/ContentTypeSettingsDisplayDriver.cs index 6e9b53f2a55..29a3ddc0fee 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Editors/ContentTypeSettingsDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Editors/ContentTypeSettingsDisplayDriver.cs @@ -1,4 +1,3 @@ -using System; using System.Linq; using System.Threading.Tasks; using Microsoft.Extensions.Localization; @@ -14,9 +13,10 @@ public class ContentTypeSettingsDisplayDriver : ContentTypeDefinitionDisplayDriv { private static readonly ContentTypeDefinitionDriverOptions _defaultOptions = new(); - protected readonly IStringLocalizer S; private readonly ContentTypeDefinitionOptions _options; + protected readonly IStringLocalizer S; + public ContentTypeSettingsDisplayDriver( IStringLocalizer stringLocalizer, IOptions options) @@ -26,8 +26,7 @@ public ContentTypeSettingsDisplayDriver( } public override IDisplayResult Edit(ContentTypeDefinition contentTypeDefinition) - { - return Initialize("ContentTypeSettings_Edit", (Action)(model => + => Initialize("ContentTypeSettings_Edit", model => { var settings = contentTypeDefinition.GetSettings(); @@ -39,9 +38,7 @@ public override IDisplayResult Edit(ContentTypeDefinition contentTypeDefinition) model.Stereotype = settings.Stereotype; model.Description = settings.Description; model.Options = GetOptions(contentTypeDefinition, settings.Stereotype); - - })).Location("Content:5"); - } + }).Location("Content:5"); public override async Task UpdateAsync(ContentTypeDefinition contentTypeDefinition, UpdateTypeEditorContext context) { @@ -72,17 +69,17 @@ private static void Apply(UpdateTypeEditorContext context, ContentTypeSettingsVi { context.Builder.Versionable(model.Versionable); } - + if (options.ShowCreatable) { context.Builder.Creatable(model.Creatable); } - + if (options.ShowSecurable) { context.Builder.Securable(model.Securable); } - + if (options.ShowListable) { context.Builder.Listable(model.Listable); @@ -91,14 +88,16 @@ private static void Apply(UpdateTypeEditorContext context, ContentTypeSettingsVi private ContentTypeDefinitionDriverOptions GetOptions(ContentTypeDefinition contentTypeDefinition, string stereotype) { - if (sterotype != null && _options.Stereotypes.TryGetValue(sterotype, out var stereotypesOptions)) + if (contentTypeDefinition.Name != null + && _options.ContentTypes.TryGetValue(contentTypeDefinition.Name, out var typeOptions)) { - return stereotypesOptions; + return typeOptions; } - if (contentTypeDefinition.Name != null && _options.ContentTypes.TryGetValue(contentTypeDefinition.Name, out var typeOptions)) + if (stereotype != null + && _options.Stereotypes.TryGetValue(stereotype, out var stereotypesOptions)) { - return typeOptions; + return stereotypesOptions; } return _defaultOptions; diff --git a/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Models/ContentTypeDefinitionOptions.cs b/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Models/ContentTypeDefinitionOptions.cs index 0be16e366a0..31d2dd0d545 100644 --- a/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Models/ContentTypeDefinitionOptions.cs +++ b/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Models/ContentTypeDefinitionOptions.cs @@ -2,9 +2,20 @@ namespace OrchardCore.ContentManagement.Metadata.Models; +/// +/// Offers a method for configuring content type definitions to either display or conceal global settings from appearing on the UI. +/// public class ContentTypeDefinitionOptions { + /// + /// Configure the driver options for all content types that share the same Stereotype. + /// In this dictionary, the 'key' denotes the Stereotype, while the 'value' corresponds to the driver options. + /// public Dictionary Stereotypes { get; } = []; + /// + /// Configure the driver options for each content type. + /// In this dictionary, the 'key' denotes the content type, while the 'value' corresponds to the driver options. + /// public Dictionary ContentTypes { get; } = []; } From 83fc7173885884ca40ab839605be13eba0101d7c Mon Sep 17 00:00:00 2001 From: Mike Alhayek Date: Sat, 23 Mar 2024 14:07:46 -0700 Subject: [PATCH 6/6] Show Securable --- .../OrchardCore.CustomSettings/Startup.cs | 8 +++++++- src/OrchardCore.Modules/OrchardCore.Users/Startup.cs | 8 +++++++- .../Models/ContentTypeDefinitionDriverOptions.cs | 9 --------- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/OrchardCore.Modules/OrchardCore.CustomSettings/Startup.cs b/src/OrchardCore.Modules/OrchardCore.CustomSettings/Startup.cs index 53ed2ff6e65..7aa3c175c99 100644 --- a/src/OrchardCore.Modules/OrchardCore.CustomSettings/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.CustomSettings/Startup.cs @@ -31,7 +31,13 @@ public override void ConfigureServices(IServiceCollection services) services.Configure(options => { - options.Stereotypes.TryAdd("CustomSettings", new ContentTypeDefinitionDriverOptions(false)); + options.Stereotypes.TryAdd("CustomSettings", new ContentTypeDefinitionDriverOptions + { + ShowCreatable = false, + ShowListable = false, + ShowDraftable = false, + ShowVersionable = false, + }); }); } } diff --git a/src/OrchardCore.Modules/OrchardCore.Users/Startup.cs b/src/OrchardCore.Modules/OrchardCore.Users/Startup.cs index d165b379ecd..393c5bf417f 100644 --- a/src/OrchardCore.Modules/OrchardCore.Users/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.Users/Startup.cs @@ -463,7 +463,13 @@ public override void ConfigureServices(IServiceCollection services) services.Configure(options => { - options.Stereotypes.TryAdd("CustomUserSettings", new ContentTypeDefinitionDriverOptions(false)); + options.Stereotypes.TryAdd("CustomUserSettings", new ContentTypeDefinitionDriverOptions + { + ShowCreatable = false, + ShowListable = false, + ShowDraftable = false, + ShowVersionable = false, + }); }); } } diff --git a/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Models/ContentTypeDefinitionDriverOptions.cs b/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Models/ContentTypeDefinitionDriverOptions.cs index 84c582d46a3..948b5b879b6 100644 --- a/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Models/ContentTypeDefinitionDriverOptions.cs +++ b/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Models/ContentTypeDefinitionDriverOptions.cs @@ -11,13 +11,4 @@ public class ContentTypeDefinitionDriverOptions public bool ShowVersionable { get; set; } public bool ShowSecurable { get; set; } - - public ContentTypeDefinitionDriverOptions(bool defaultValue = true) - { - ShowCreatable = defaultValue; - ShowListable = defaultValue; - ShowDraftable = defaultValue; - ShowVersionable = defaultValue; - ShowSecurable = defaultValue; - } }