C# Class CardShop.Auth.AuthorizeUserAttribute

Used to specify a method or class that requires authentication.
Inheritance: System.Web.Mvc.AuthorizeAttribute
Show file Open project: egreene/PracticeGDVP Class Usage Examples

Public Methods

Method Description
AuthorizeUserAttribute ( ) : System

Requires the user to be logged in, but not of any particular role.

Protected Methods

Method Description
AuthorizeCore ( System.Web.HttpContextBase httpContext ) : bool

Will check to see if the currently-acting user has any of the provided roles. Otherwise, if no roles are specified, the check will merely be to see if the user is logged in.

HandleUnauthorizedRequest ( System.Web.Mvc.AuthorizationContext filterContext ) : void

If the user is logged in, a 403 view will be rendered. If the user is not logged in, the action will be passed onto the default handler (asking them to login).

Method Details

AuthorizeCore() protected method

Will check to see if the currently-acting user has any of the provided roles. Otherwise, if no roles are specified, the check will merely be to see if the user is logged in.
protected AuthorizeCore ( System.Web.HttpContextBase httpContext ) : bool
httpContext System.Web.HttpContextBase
return bool

AuthorizeUserAttribute() public method

Requires the user to be logged in, but not of any particular role.
public AuthorizeUserAttribute ( ) : System
return System

HandleUnauthorizedRequest() protected method

If the user is logged in, a 403 view will be rendered. If the user is not logged in, the action will be passed onto the default handler (asking them to login).
protected HandleUnauthorizedRequest ( System.Web.Mvc.AuthorizationContext filterContext ) : void
filterContext System.Web.Mvc.AuthorizationContext
return void