C# Class CardShop.Auth.UserAuth

Inheritance: IUserAuth
Show file Open project: egreene/PracticeGDVP

Public Methods

Method Description
CreateSession ( ) : void

Creates a new UserAuth for the current session.

FindUser ( IPrincipal principal ) : User
GetUserAuth ( IHttpContext context ) : IUserAuth

Returns an IUserAuth with the specified HttpContext.

HasRole ( ) : 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.

IsActive ( ) : bool
IsLoggedIn ( ) : bool

Returns whether there is a logged-in user stored in session.

Login ( IPrincipal principal ) : bool
Logout ( ) : void

Logs out the current user.

Method Details

CreateSession() public static method

Creates a new UserAuth for the current session.
public static CreateSession ( ) : void
return void

FindUser() public method

public FindUser ( IPrincipal principal ) : User
principal IPrincipal
return CardShop.Models.User

GetUserAuth() public static method

Returns an IUserAuth with the specified HttpContext.
public static GetUserAuth ( IHttpContext context ) : IUserAuth
context IHttpContext
return IUserAuth

HasRole() public 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.
public HasRole ( ) : bool
return bool

IsActive() public method

public IsActive ( ) : bool
return bool

IsLoggedIn() public method

Returns whether there is a logged-in user stored in session.
public IsLoggedIn ( ) : bool
return bool

Login() public method

public Login ( IPrincipal principal ) : bool
principal IPrincipal
return bool

Logout() public method

Logs out the current user.
public Logout ( ) : void
return void