* Run code cleanup * Run dotnet format * Start manual cleanup in Web.Common * Finish up manual cleanup * Fix tests * Fix up InMemoryModelFactory.cs * Inject proper macroRenderer * Update src/Umbraco.Web.Common/Filters/JsonDateTimeFormatAttribute.cs Co-authored-by: Mole <nikolajlauridsen@protonmail.ch> * Update src/Umbraco.Web.Common/Filters/ValidateUmbracoFormRouteStringAttribute.cs Co-authored-by: Mole <nikolajlauridsen@protonmail.ch> * Fix based on review Co-authored-by: Nikolaj Geisle <niko737@edu.ucl.dk> Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>
27 lines
949 B
C#
27 lines
949 B
C#
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Umbraco.Cms.Core.Features;
|
|
using Umbraco.Cms.Web.Common.Attributes;
|
|
using Umbraco.Cms.Web.Common.Authorization;
|
|
|
|
namespace Umbraco.Cms.Web.Common.Controllers;
|
|
|
|
/// <summary>
|
|
/// Provides a base class for Umbraco API controllers.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>These controllers are NOT auto-routed.</para>
|
|
/// <para>The base class is <see cref="ControllerBase" /> which are netcore API controllers without any view support</para>
|
|
/// </remarks>
|
|
[Authorize(Policy = AuthorizationPolicies.UmbracoFeatureEnabled)] // TODO: This could be part of our conventions
|
|
[UmbracoApiController]
|
|
public abstract class UmbracoApiControllerBase : ControllerBase, IUmbracoFeature
|
|
{
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="UmbracoApiControllerBase" /> class.
|
|
/// </summary>
|
|
protected UmbracoApiControllerBase()
|
|
{
|
|
}
|
|
}
|