Class UmbracoAuthorizedApiController
- Namespace
- Umbraco.Cms.Web.BackOffice.Controllers
- Assembly
- Umbraco.Web.BackOffice.dll
Provides a base class for authorized auto-routed Umbraco API controllers.
[Authorize(Policy = "BackOfficeAccess")]
[UmbracoRequireHttps]
[MiddlewareFilter(typeof(UnhandledExceptionLoggerFilter))]
public abstract class UmbracoAuthorizedApiController : UmbracoApiController
- Inheritance
-
UmbracoAuthorizedApiController
- Derived
Remarks
This controller will also append a custom header to the response if the user is logged in using forms authentication which indicates the seconds remaining before their timeout expires.
Constructors
UmbracoAuthorizedApiController()
protected UmbracoAuthorizedApiController()
Methods
GetValidationProblemDetails(string?, string?, int?, string?, string?, ModelStateDictionary?)
protected ValidationProblemDetails? GetValidationProblemDetails(string? detail = null, string? instance = null, int? statusCode = null, string? title = null, string? type = null, ModelStateDictionary? modelStateDictionary = null)
Parameters
detailstringinstancestringstatusCodeint?titlestringtypestringmodelStateDictionaryModelStateDictionary
Returns
ValidationProblem(ModelStateDictionary)
Overridden to return Umbraco compatible errors
[NonAction]
public override ActionResult ValidationProblem(ModelStateDictionary modelStateDictionary)
Parameters
modelStateDictionaryModelStateDictionary
Returns
ValidationProblem(object?, int)
Returns an Umbraco compatible validation problem for the object result
protected virtual ActionResult ValidationProblem(object? value, int statusCode)
Parameters
Returns
ValidationProblem(string)
Returns an Umbraco compatible validation problem for the given error message
protected virtual ActionResult ValidationProblem(string errorMessage)
Parameters
errorMessagestring
Returns
ValidationProblem(IErrorModel?, ModelStateDictionary, int)
Returns a validation problem result for the Umbraco.Cms.Core.Models.ContentEditing.IErrorModel and the ModelStateDictionary
protected virtual ActionResult ValidationProblem(IErrorModel? model, ModelStateDictionary modelStateDictionary, int statusCode = 400)
Parameters
modelIErrorModelmodelStateDictionaryModelStateDictionarystatusCodeint
Returns
ValidationProblem(INotificationModel?, int)
Returns an Umbraco compatible validation problem for the given notification model
protected virtual ActionResult ValidationProblem(INotificationModel? model, int statusCode = 400)
Parameters
modelINotificationModelstatusCodeint