C# Class CardShop.Auth.UserAuth

Inheritance: IUserAuth
Afficher le fichier Open project: egreene/PracticeGDVP

Méthodes publiques

Méthode 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 méthode

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

FindUser() public méthode

public FindUser ( IPrincipal principal ) : User
principal IPrincipal
Résultat CardShop.Models.User

GetUserAuth() public static méthode

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

HasRole() public méthode

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
Résultat bool

IsActive() public méthode

public IsActive ( ) : bool
Résultat bool

IsLoggedIn() public méthode

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

Login() public méthode

public Login ( IPrincipal principal ) : bool
principal IPrincipal
Résultat bool

Logout() public méthode

Logs out the current user.
public Logout ( ) : void
Résultat void