diff --git a/src/OrchardCore.Modules/OrchardCore.ArchiveLater/Startup.cs b/src/OrchardCore.Modules/OrchardCore.ArchiveLater/Startup.cs index dd1999e5366..a53988073d5 100644 --- a/src/OrchardCore.Modules/OrchardCore.ArchiveLater/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.ArchiveLater/Startup.cs @@ -17,7 +17,6 @@ namespace OrchardCore.ArchiveLater; public class Startup : StartupBase { - public override void ConfigureServices(IServiceCollection services) { services.Configure(o => diff --git a/src/OrchardCore.Modules/OrchardCore.Facebook/PixelPermissionProvider.cs b/src/OrchardCore.Modules/OrchardCore.Facebook/PixelPermissionProvider.cs index 6807439f81f..321448b76ef 100644 --- a/src/OrchardCore.Modules/OrchardCore.Facebook/PixelPermissionProvider.cs +++ b/src/OrchardCore.Modules/OrchardCore.Facebook/PixelPermissionProvider.cs @@ -1,9 +1,11 @@ using System.Collections.Generic; using System.Threading.Tasks; +using OrchardCore.Modules; using OrchardCore.Security.Permissions; namespace OrchardCore.Facebook; +[Feature(FacebookConstants.Features.Pixel)] public class PixelPermissionProvider : IPermissionProvider { public static readonly Permission ManageFacebookPixelPermission = FacebookConstants.ManageFacebookPixelPermission; diff --git a/src/OrchardCore.Modules/OrchardCore.Google/GoogleAnalyticsPermissionsProvider.cs b/src/OrchardCore.Modules/OrchardCore.Google/GoogleAnalyticsPermissionsProvider.cs index 81ff3e6cd88..b3154e667cf 100644 --- a/src/OrchardCore.Modules/OrchardCore.Google/GoogleAnalyticsPermissionsProvider.cs +++ b/src/OrchardCore.Modules/OrchardCore.Google/GoogleAnalyticsPermissionsProvider.cs @@ -1,9 +1,11 @@ using System.Collections.Generic; using System.Threading.Tasks; +using OrchardCore.Modules; using OrchardCore.Security.Permissions; namespace OrchardCore.Google; +[Feature(GoogleConstants.Features.GoogleAnalytics)] public class GoogleAnalyticsPermissionsProvider : IPermissionProvider { public static readonly Permission ManageGoogleAnalytics = Permissions.ManageGoogleAnalytics; diff --git a/src/OrchardCore.Modules/OrchardCore.Google/GoogleAuthenticationPermissionProvider.cs b/src/OrchardCore.Modules/OrchardCore.Google/GoogleAuthenticationPermissionProvider.cs index 73c5197ed23..1fc31f13208 100644 --- a/src/OrchardCore.Modules/OrchardCore.Google/GoogleAuthenticationPermissionProvider.cs +++ b/src/OrchardCore.Modules/OrchardCore.Google/GoogleAuthenticationPermissionProvider.cs @@ -1,9 +1,11 @@ using System.Collections.Generic; using System.Threading.Tasks; +using OrchardCore.Modules; using OrchardCore.Security.Permissions; namespace OrchardCore.Google; +[Feature(GoogleConstants.Features.GoogleAuthentication)] public class GoogleAuthenticationPermissionProvider : IPermissionProvider { public static readonly Permission ManageGoogleAuthentication = Permissions.ManageGoogleAuthentication; diff --git a/src/OrchardCore.Modules/OrchardCore.Google/GoogleTagManagerPermissionProvider.cs b/src/OrchardCore.Modules/OrchardCore.Google/GoogleTagManagerPermissionProvider.cs index 61ce08af13b..eef588e9982 100644 --- a/src/OrchardCore.Modules/OrchardCore.Google/GoogleTagManagerPermissionProvider.cs +++ b/src/OrchardCore.Modules/OrchardCore.Google/GoogleTagManagerPermissionProvider.cs @@ -1,9 +1,11 @@ using System.Collections.Generic; using System.Threading.Tasks; +using OrchardCore.Modules; using OrchardCore.Security.Permissions; namespace OrchardCore.Google; +[Feature(GoogleConstants.Features.GoogleTagManager)] public class GoogleTagManagerPermissionProvider : IPermissionProvider { public static readonly Permission ManageGoogleTagManager = Permissions.ManageGoogleTagManager; diff --git a/src/OrchardCore.Modules/OrchardCore.Media.Azure/Permissions.cs b/src/OrchardCore.Modules/OrchardCore.Media.Azure/Permissions.cs index db9841caed5..bc6bf5bb4f9 100644 --- a/src/OrchardCore.Modules/OrchardCore.Media.Azure/Permissions.cs +++ b/src/OrchardCore.Modules/OrchardCore.Media.Azure/Permissions.cs @@ -1,9 +1,11 @@ using System.Collections.Generic; using System.Threading.Tasks; +using OrchardCore.Modules; using OrchardCore.Security.Permissions; namespace OrchardCore.Media.Azure; +[Feature("OrchardCore.Media.Azure.Storage")] public class Permissions : IPermissionProvider { public static readonly Permission ViewAzureMediaOptions = new("ViewAzureMediaOptions", "View Azure Media Options"); diff --git a/src/OrchardCore.Modules/OrchardCore.Media/MediaCachePermissions.cs b/src/OrchardCore.Modules/OrchardCore.Media/MediaCachePermissions.cs index bcffcc63c65..c5638ffaada 100644 --- a/src/OrchardCore.Modules/OrchardCore.Media/MediaCachePermissions.cs +++ b/src/OrchardCore.Modules/OrchardCore.Media/MediaCachePermissions.cs @@ -1,9 +1,11 @@ using System.Collections.Generic; using System.Threading.Tasks; +using OrchardCore.Modules; using OrchardCore.Security.Permissions; namespace OrchardCore.Media; +[Feature("OrchardCore.Media.Cache")] public class MediaCachePermissions : IPermissionProvider { public static readonly Permission ManageAssetCache = new("ManageAssetCache", "Manage Asset Cache Folder"); diff --git a/src/OrchardCore.Modules/OrchardCore.OpenId/Startup.cs b/src/OrchardCore.Modules/OrchardCore.OpenId/Startup.cs index 709b4fc4cd6..e8f54fdaade 100644 --- a/src/OrchardCore.Modules/OrchardCore.OpenId/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.OpenId/Startup.cs @@ -53,11 +53,11 @@ public override void ConfigureServices(IServiceCollection services) }); // Note: the following services are registered using TryAddEnumerable to prevent duplicate registrations. - services.TryAddEnumerable(new[] - { + services.TryAddEnumerable( + [ ServiceDescriptor.Scoped(), ServiceDescriptor.Scoped(), - }); + ]); } } diff --git a/src/OrchardCore.Modules/OrchardCore.PublishLater/Startup.cs b/src/OrchardCore.Modules/OrchardCore.PublishLater/Startup.cs index e984eae1aa3..ff1f5643a66 100644 --- a/src/OrchardCore.Modules/OrchardCore.PublishLater/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.PublishLater/Startup.cs @@ -17,7 +17,6 @@ namespace OrchardCore.PublishLater { public class Startup : StartupBase { - public override void ConfigureServices(IServiceCollection services) { services.Configure(o => diff --git a/src/OrchardCore.Modules/OrchardCore.Queries/Sql/Permissions.cs b/src/OrchardCore.Modules/OrchardCore.Queries/Sql/Permissions.cs index ea81d34c2d8..63e9178e29c 100644 --- a/src/OrchardCore.Modules/OrchardCore.Queries/Sql/Permissions.cs +++ b/src/OrchardCore.Modules/OrchardCore.Queries/Sql/Permissions.cs @@ -1,9 +1,11 @@ using System.Collections.Generic; using System.Threading.Tasks; +using OrchardCore.Modules; using OrchardCore.Security.Permissions; namespace OrchardCore.Queries.Sql; +[Feature("OrchardCore.Queries.Sql")] public class Permissions : IPermissionProvider { public static readonly Permission ManageSqlQueries = new("ManageSqlQueries", "Manage SQL Queries"); diff --git a/src/OrchardCore.Modules/OrchardCore.ReCaptcha/Startup.cs b/src/OrchardCore.Modules/OrchardCore.ReCaptcha/Startup.cs index 32274a3b8e1..30485771fdb 100644 --- a/src/OrchardCore.Modules/OrchardCore.ReCaptcha/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.ReCaptcha/Startup.cs @@ -15,7 +15,6 @@ namespace OrchardCore.ReCaptcha { - [Feature("OrchardCore.ReCaptcha")] public sealed class Startup : StartupBase { public override void ConfigureServices(IServiceCollection services) @@ -28,7 +27,6 @@ public override void ConfigureServices(IServiceCollection services) } } - [Feature("OrchardCore.ReCaptcha")] [RequireFeatures("OrchardCore.Deployment")] public sealed class DeploymentStartup : StartupBase { diff --git a/src/OrchardCore.Modules/OrchardCore.Seo/Startup.cs b/src/OrchardCore.Modules/OrchardCore.Seo/Startup.cs index e7a29994e1f..05966b4c1a6 100644 --- a/src/OrchardCore.Modules/OrchardCore.Seo/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.Seo/Startup.cs @@ -34,7 +34,7 @@ public override void ConfigureServices(IServiceCollection services) services.AddScoped(); services.AddScoped(); - // This must be last, and the module dependant on Contents so this runs after the part handlers. + // This must be last, and the module dependent on Contents so this runs after the part handlers. services.AddScoped(); services.AddScoped(); diff --git a/src/OrchardCore.Modules/OrchardCore.Shortcodes/Permissions.cs b/src/OrchardCore.Modules/OrchardCore.Shortcodes/Permissions.cs index 8235a7b116a..2c4f09ef6b0 100644 --- a/src/OrchardCore.Modules/OrchardCore.Shortcodes/Permissions.cs +++ b/src/OrchardCore.Modules/OrchardCore.Shortcodes/Permissions.cs @@ -1,9 +1,11 @@ using System.Collections.Generic; using System.Threading.Tasks; +using OrchardCore.Modules; using OrchardCore.Security.Permissions; namespace OrchardCore.Shortcodes; +[Feature("OrchardCore.Shortcodes.Templates")] public class Permissions : IPermissionProvider { public static readonly Permission ManageShortcodeTemplates = new("ManageShortcodeTemplates", "Manage shortcode templates", isSecurityCritical: true); diff --git a/src/OrchardCore.Modules/OrchardCore.Users/CustomUserSettingsPermissions.cs b/src/OrchardCore.Modules/OrchardCore.Users/CustomUserSettingsPermissions.cs index 34ae7358af1..c9bac10de86 100644 --- a/src/OrchardCore.Modules/OrchardCore.Users/CustomUserSettingsPermissions.cs +++ b/src/OrchardCore.Modules/OrchardCore.Users/CustomUserSettingsPermissions.cs @@ -3,10 +3,12 @@ using System.Threading.Tasks; using OrchardCore.ContentManagement.Metadata; using OrchardCore.ContentManagement.Metadata.Models; +using OrchardCore.Modules; using OrchardCore.Security.Permissions; namespace OrchardCore.Users; +[Feature("OrchardCore.Users.CustomUserSettings")] public class CustomUserSettingsPermissions : IPermissionProvider { // This permission is never checked it is only used as a template.