Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seal all controllers #16576

Merged
merged 5 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace OrchardCore.Admin.Controllers;

[Authorize]
public class AdminController : Controller
public sealed class AdminController : Controller
{
public IActionResult Index()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
namespace OrchardCore.AdminDashboard.Controllers;

[Admin]
public class DashboardController : Controller
public sealed class DashboardController : Controller
{
private readonly IAuthorizationService _authorizationService;
private readonly IAdminDashboardService _adminDashboardService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
namespace OrchardCore.AdminMenu.Controllers;

[Admin("AdminMenu/{action}/{id?}", "AdminMenu{action}")]
public class MenuController : Controller
public sealed class MenuController : Controller
{
private const string _optionsSearch = "Options.Search";

Expand All @@ -28,8 +28,8 @@ public class MenuController : Controller
private readonly INotifier _notifier;
private readonly ILogger _logger;

protected readonly IStringLocalizer S;
protected readonly IHtmlLocalizer H;
internal readonly IStringLocalizer S;
internal readonly IHtmlLocalizer H;

public MenuController(
IAuthorizationService authorizationService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
namespace OrchardCore.AdminMenu.Controllers;

[Admin("AdminMenu/Node/{action}", "AdminMenuNode{action}")]
public class NodeController : Controller
public sealed class NodeController : Controller
{
private readonly IAuthorizationService _authorizationService;
private readonly IDisplayManager<MenuItem> _displayManager;
private readonly IEnumerable<IAdminNodeProviderFactory> _factories;
private readonly IAdminMenuService _adminMenuService;
private readonly INotifier _notifier;
protected readonly IHtmlLocalizer H;
private readonly IUpdateModelAccessor _updateModelAccessor;

internal readonly IHtmlLocalizer H;

public NodeController(
IAuthorizationService authorizationService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace OrchardCore.Apis.GraphQL.Controllers;

public class AdminController : Controller
public sealed class AdminController : Controller
{
[HttpGet]
[Admin("GraphQL", "GraphQL")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

namespace OrchardCore.AuditTrail.Controllers;

public class AdminController : Controller
public sealed class AdminController : Controller
{
private readonly PagerOptions _pagerOptions;
private readonly IShapeFactory _shapeFactory;
Expand All @@ -25,7 +25,8 @@ public class AdminController : Controller
private readonly IAuditTrailAdminListQueryService _auditTrailAdminListQueryService;
private readonly IDisplayManager<AuditTrailEvent> _displayManager;
private readonly IDisplayManager<AuditTrailIndexOptions> _auditTrailOptionsDisplayManager;
protected readonly IStringLocalizer S;

internal readonly IStringLocalizer S;

public AdminController(
IOptions<PagerOptions> pagerOptions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
namespace OrchardCore.BackgroundTasks.Controllers;

[Admin("BackgroundTasks/{action}/{name?}", "BackgroundTasks{action}")]
public class BackgroundTaskController : Controller
public sealed class BackgroundTaskController : Controller
{
private const string _optionsSearch = $"{nameof(BackgroundTaskIndexViewModel.Options)}.{nameof(AdminIndexOptions.Search)}";
private const string _optionsStatus = $"{nameof(BackgroundTaskIndexViewModel.Options)}.{nameof(AdminIndexOptions.Status)}";
Expand All @@ -29,8 +29,8 @@ public class BackgroundTaskController : Controller
private readonly INotifier _notifier;
private readonly IShapeFactory _shapeFactory;

protected readonly IStringLocalizer S;
protected readonly IHtmlLocalizer H;
internal readonly IStringLocalizer S;
internal readonly IHtmlLocalizer H;

public BackgroundTaskController(
IAuthorizationService authorizationService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace OrchardCore.ContentFields.Controllers;

[Admin]
public class ContentPickerAdminController : Controller
public sealed class ContentPickerAdminController : Controller
{
private readonly IContentDefinitionManager _contentDefinitionManager;
private readonly IContentManager _contentManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace OrchardCore.ContentFields.Controllers;

[RequireFeatures("OrchardCore.ContentLocalization")]
[Admin]
public class LocalizationSetContentPickerAdminController : Controller
public sealed class LocalizationSetContentPickerAdminController : Controller
{
private readonly IContentDefinitionManager _contentDefinitionManager;
private readonly IContentLocalizationManager _contentLocalizationManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

namespace OrchardCore.ContentFields.Controllers;

[RequireFeatures(OrchardCore.Users.UserConstants.Features.Users)]
[RequireFeatures(Users.UserConstants.Features.Users)]
[Admin]
public class UserPickerAdminController : Controller
public sealed class UserPickerAdminController : Controller
{
private readonly IContentDefinitionManager _contentDefinitionManager;
private readonly IContentManager _contentManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@

namespace OrchardCore.ContentLocalization.Controllers;

public class AdminController : Controller
public sealed class AdminController : Controller
{
private readonly IContentManager _contentManager;
private readonly IContentLocalizationManager _contentLocalizationManager;
private readonly INotifier _notifier;
private readonly IAuthorizationService _authorizationService;
protected readonly IHtmlLocalizer H;

internal readonly IHtmlLocalizer H;

public AdminController(
IContentManager contentManager,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace OrchardCore.ContentLocalization.Controllers;

[Feature("OrchardCore.ContentLocalization.ContentCulturePicker")]
public class ContentCulturePickerController : Controller
public sealed class ContentCulturePickerController : Controller
{
private readonly ISiteService _siteService;
private readonly ILocalizationService _locationService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace OrchardCore.ContentPreview.Controllers;

public class PreviewController : Controller
public sealed class PreviewController : Controller
{
private readonly IContentManager _contentManager;
private readonly IContentManagerSession _contentManagerSession;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,19 @@

namespace OrchardCore.ContentTypes.Controllers;

public class AdminController : Controller
public sealed class AdminController : Controller
{
private readonly IContentDefinitionService _contentDefinitionService;
private readonly IContentDefinitionManager _contentDefinitionManager;
private readonly IAuthorizationService _authorizationService;
private readonly IDocumentStore _documentStore;
private readonly IContentDefinitionDisplayManager _contentDefinitionDisplayManager;
protected readonly IHtmlLocalizer H;
protected readonly IStringLocalizer S;
private readonly INotifier _notifier;
private readonly IUpdateModelAccessor _updateModelAccessor;

internal readonly IHtmlLocalizer H;
internal readonly IStringLocalizer S;

public AdminController(
IContentDefinitionDisplayManager contentDefinitionDisplayManager,
IContentDefinitionService contentDefinitionService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,18 @@ namespace OrchardCore.Contents.AuditTrail.Controllers;

[RequireFeatures("OrchardCore.AuditTrail")]
[Admin("AuditTrail/Content/{action}/{auditTrailEventId}", "{action}AuditTrailContent")]
public class AuditTrailContentController : Controller
public sealed class AuditTrailContentController : Controller
{
private readonly ISession _session;
private readonly IContentManager _contentManager;
private readonly IUpdateModelAccessor _updateModelAccessor;
private readonly IAuthorizationService _authorizationService;
private readonly IContentItemDisplayManager _contentItemDisplayManager;
private readonly INotifier _notifier;
protected readonly IHtmlLocalizer H;
private readonly ILogger _logger;

internal readonly IHtmlLocalizer H;

public AuditTrailContentController(
ISession session,
IContentManager contentManager,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

namespace OrchardCore.Contents.Controllers;

public class AdminController : Controller, IUpdateModel
public sealed class AdminController : Controller, IUpdateModel
{
private readonly IAuthorizationService _authorizationService;
private readonly IContentManager _contentManager;
Expand All @@ -36,8 +36,8 @@ public class AdminController : Controller, IUpdateModel
private readonly ISession _session;
private readonly INotifier _notifier;

protected readonly IHtmlLocalizer H;
protected readonly IStringLocalizer S;
internal readonly IHtmlLocalizer H;
internal readonly IStringLocalizer S;

public AdminController(
IAuthorizationService authorizationService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace OrchardCore.Contents.Controllers;

public class ItemController : Controller, IUpdateModel
public sealed class ItemController : Controller, IUpdateModel
{
private readonly IContentManager _contentManager;
private readonly IContentItemDisplayManager _contentItemDisplayManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ namespace OrchardCore.Contents.Deployment.AddToDeploymentPlan;

[Feature("OrchardCore.Contents.Deployment.AddToDeploymentPlan")]
[Admin("AddToDeploymentPlan/{action}/{deploymentPlanId}", AdminAttribute.NameFromControllerAndAction)]
public class AddToDeploymentPlanController : Controller
public sealed class AddToDeploymentPlanController : Controller
{
private readonly IAuthorizationService _authorizationService;
private readonly IContentManager _contentManager;
private readonly ISession _session;
private readonly IEnumerable<IDeploymentStepFactory> _factories;
private readonly INotifier _notifier;
protected readonly IHtmlLocalizer H;

internal readonly IHtmlLocalizer H;

public AddToDeploymentPlanController(
IAuthorizationService authorizationService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace OrchardCore.Contents.Deployment.Download;

[Admin("Download/{action}/{contentItemId}", AdminAttribute.NameFromControllerAndAction)]
[Feature("OrchardCore.Contents.Deployment.Download")]
public class DownloadController : Controller
public sealed class DownloadController : Controller
{
private readonly IAuthorizationService _authorizationService;
private readonly IContentManager _contentManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@
namespace OrchardCore.Cors.Controllers;

[Admin]
public class AdminController : Controller
public sealed class AdminController : Controller
{
private readonly IShellHost _shellHost;
private readonly ShellSettings _shellSettings;
private readonly IAuthorizationService _authorizationService;
private readonly CorsService _corsService;
private readonly INotifier _notifier;
protected readonly IHtmlLocalizer H;

internal readonly IHtmlLocalizer H;

public AdminController(
IShellHost shellHost,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace OrchardCore.Demo.Controllers;

public class AdminController : Controller
public sealed class AdminController : Controller
{
public IActionResult Index()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ namespace OrchardCore.Demo.Controllers;
[Route("api/demo")]
[Authorize(AuthenticationSchemes = "Api"), IgnoreAntiforgeryToken, AllowAnonymous]
[ApiController]
public class ContentApiController : ControllerBase
public sealed class ContentApiController : ControllerBase
{
private readonly IAuthorizationService _authorizationService;
private readonly IContentManager _contentManager;

public ContentApiController(IAuthorizationService authorizationService, IContentManager contentManager)
public ContentApiController(
IAuthorizationService authorizationService,
IContentManager contentManager)
{
_authorizationService = authorizationService;
_contentManager = contentManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace OrchardCore.Demo.Controllers;

public class ContentController : Controller
public sealed class ContentController : Controller
{
private readonly IContentItemDisplayManager _contentDisplay;
private readonly IContentManager _contentManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace OrchardCore.Demo.Controllers;

public class DemoController : Controller
public sealed class DemoController : Controller
{
[Route("Demo")]
[Route("Demo/Index")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

namespace OrchardCore.Demo.Controllers;

public class HomeController : Controller
public sealed class HomeController : Controller
{
private readonly ITestDependency _testDependency;
private readonly IContentManager _contentManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace OrchardCore.Demo.Controllers;

public class TodoController : Controller
public sealed class TodoController : Controller
{
private readonly ISession _session;
private readonly Entities.IIdGenerator _idGenerator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@
namespace OrchardCore.Deployment.Remote.Controllers;

[Admin("Deployment/ExportRemoteInstance/{action}/{id?}", "DeploymentExportRemoteInstance{action}")]
public class ExportRemoteInstanceController : Controller
public sealed class ExportRemoteInstanceController : Controller
{
private readonly IDeploymentManager _deploymentManager;
private readonly IAuthorizationService _authorizationService;
private readonly ISession _session;
private readonly RemoteInstanceService _service;
private readonly INotifier _notifier;
private readonly IHttpClientFactory _httpClientFactory;
protected readonly IHtmlLocalizer H;

internal readonly IHtmlLocalizer H;

public ExportRemoteInstanceController(
IAuthorizationService authorizationService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@

namespace OrchardCore.Deployment.Remote.Controllers;

public class ImportRemoteInstanceController : Controller
public sealed class ImportRemoteInstanceController : Controller
{
private readonly RemoteClientService _remoteClientService;
private readonly IDeploymentManager _deploymentManager;
private readonly INotifier _notifier;
private readonly ILogger _logger;
private readonly IDataProtector _dataProtector;

protected readonly IHtmlLocalizer H;
protected readonly IStringLocalizer S;
internal readonly IHtmlLocalizer H;
internal readonly IStringLocalizer S;

public ImportRemoteInstanceController(
IDataProtectionProvider dataProtectionProvider,
Expand Down
Loading