Class UmbracoAuthorizeAttribute
Ensures authorization is successful for a back office user.
Inheritance
System.Object
Namespace: Umbraco.Web.Mvc
Assembly: Umbraco.Web.dll
Syntax
public sealed class UmbracoAuthorizeAttribute : AuthorizeAttribute
Constructors
View SourceUmbracoAuthorizeAttribute()
Default constructor
Declaration
public UmbracoAuthorizeAttribute()
UmbracoAuthorizeAttribute(Boolean)
Constructor specifying to redirect to the umbraco login page if not authorized
Declaration
public UmbracoAuthorizeAttribute(bool redirectToUmbracoLogin)
Parameters
Type | Name | Description |
---|---|---|
System. |
redirectToUmbracoLogin |
UmbracoAuthorizeAttribute(String)
Constructor specifying to redirect to the specified location if not authorized
Declaration
public UmbracoAuthorizeAttribute(string redirectUrl)
Parameters
Type | Name | Description |
---|---|---|
System. |
redirectUrl |
UmbracoAuthorizeAttribute(UmbracoContext, IRuntimeState)
THIS SHOULD BE ONLY USED FOR UNIT TESTS
Declaration
public UmbracoAuthorizeAttribute(UmbracoContext umbracoContext, IRuntimeState runtimeState)
Parameters
Type | Name | Description |
---|---|---|
Umbraco |
umbracoContext | |
IRuntime |
runtimeState |
Methods
View SourceAuthorizeCore(HttpContextBase)
Ensures that the user must be in the Administrator or the Install role
Declaration
protected override bool AuthorizeCore(HttpContextBase httpContext)
Parameters
Type | Name | Description |
---|---|---|
System. |
httpContext |
Returns
Type | Description |
---|---|
System. |
HandleUnauthorizedRequest(AuthorizationContext)
Override to ensure no redirect occurs
Declaration
protected override void HandleUnauthorizedRequest(AuthorizationContext filterContext)
Parameters
Type | Name | Description |
---|---|---|
Authorization |
filterContext |