2021-01-13 16:08:00 +01:00
|
|
|
using Microsoft.AspNetCore.Authorization;
|
2020-11-20 12:40:29 +11:00
|
|
|
using Microsoft.AspNetCore.Mvc;
|
2021-02-18 11:06:02 +01:00
|
|
|
using Umbraco.Cms.Core.Features;
|
|
|
|
|
using Umbraco.Cms.Web.Common.Attributes;
|
|
|
|
|
using Umbraco.Cms.Web.Common.Authorization;
|
2020-04-20 12:20:47 +02:00
|
|
|
|
2022-05-09 09:39:46 +02:00
|
|
|
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
|
2020-04-20 12:20:47 +02:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
2022-05-09 09:39:46 +02:00
|
|
|
/// Initializes a new instance of the <see cref="UmbracoApiControllerBase" /> class.
|
2020-04-20 12:20:47 +02:00
|
|
|
/// </summary>
|
2022-05-09 09:39:46 +02:00
|
|
|
protected UmbracoApiControllerBase()
|
2020-04-20 12:20:47 +02:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
}
|