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.Boolean | redirectToUmbracoLogin |
UmbracoAuthorizeAttribute(String)
Constructor specifying to redirect to the specified location if not authorized
Declaration
public UmbracoAuthorizeAttribute(string redirectUrl)
Parameters
Type | Name | Description |
---|---|---|
System.String | redirectUrl |
UmbracoAuthorizeAttribute(UmbracoContext, IRuntimeState)
THIS SHOULD BE ONLY USED FOR UNIT TESTS
Declaration
public UmbracoAuthorizeAttribute(UmbracoContext umbracoContext, IRuntimeState runtimeState)
Parameters
Type | Name | Description |
---|---|---|
UmbracoContext | umbracoContext | |
IRuntimeState | 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.Web.HttpContextBase | httpContext |
Returns
Type | Description |
---|---|
System.Boolean |
HandleUnauthorizedRequest(AuthorizationContext)
Override to ensure no redirect occurs
Declaration
protected override void HandleUnauthorizedRequest(AuthorizationContext filterContext)
Parameters
Type | Name | Description |
---|---|---|
AuthorizationContext | filterContext |