Revert "Add status endpoint"

This reverts commit b594ad8ccf.
This commit is contained in:
Nikolaj
2022-11-28 14:42:22 +01:00
parent b594ad8ccf
commit 7342fde17f
3 changed files with 0 additions and 52 deletions

View File

@@ -1,31 +0,0 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.ManagementApi.ViewModels.RedirectManagement;
using Umbraco.Extensions;
namespace Umbraco.Cms.ManagementApi.Controllers.RedirectManagement;
public class GetEnabledController : RedirectManagementBaseController
{
private readonly IOptionsMonitor<WebRoutingSettings> _webRoutingSettings;
private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor;
public GetEnabledController(
IOptionsMonitor<WebRoutingSettings> webRoutingSettings,
IBackOfficeSecurityAccessor backOfficeSecurityAccessor)
{
_webRoutingSettings = webRoutingSettings;
_backOfficeSecurityAccessor = backOfficeSecurityAccessor;
}
[HttpGet("status")]
public Task<ActionResult<RedirectStatusViewModel>> GetStatus() =>
Task.FromResult<ActionResult<RedirectStatusViewModel>>(new RedirectStatusViewModel
{
Enabled = _webRoutingSettings.CurrentValue.DisableRedirectUrlTracking is false,
UserIsAdmin = _backOfficeSecurityAccessor.BackOfficeSecurity?.CurrentUser?.IsAdmin() ?? false
});
}

View File

@@ -1,13 +0,0 @@
using Microsoft.AspNetCore.Mvc;
using Umbraco.New.Cms.Web.Common.Routing;
namespace Umbraco.Cms.ManagementApi.Controllers.RedirectManagement;
[ApiController]
[VersionedApiBackOfficeRoute("redirect-management")]
[ApiExplorerSettings(GroupName = "Redirect Management")]
[ApiVersion("1.0")]
public class RedirectManagementBaseController
{
}

View File

@@ -1,8 +0,0 @@
namespace Umbraco.Cms.ManagementApi.ViewModels.RedirectManagement;
public class RedirectStatusViewModel
{
public bool Enabled { get; set; }
public bool UserIsAdmin { get; set; }
}