C# Class ServiceStack.RequiredRoleAttribute

Inheritance: ServiceStack.AuthenticateAttribute
Mostra file Open project: nustack/ServiceStack Class Usage Examples

Public Methods

Method Description
AssertRequiredRoles ( IRequest request ) : void

Check all session is in all supplied roles otherwise a 401 HttpError is thrown

Execute ( IRequest req, IResponse res, object requestDto ) : void
HasAllRoles ( IAuthSession session ) : bool
HasAllRoles ( IRequest req, IAuthSession session, IAuthRepository userAuthRepo = null ) : bool
RequiredRoleAttribute ( ) : System
RequiredRoleAttribute ( ApplyTo applyTo ) : System

Method Details

AssertRequiredRoles() public static method

Check all session is in all supplied roles otherwise a 401 HttpError is thrown
public static AssertRequiredRoles ( IRequest request ) : void
request IRequest
return void

Execute() public method

public Execute ( IRequest req, IResponse res, object requestDto ) : void
req IRequest
res IResponse
requestDto object
return void

HasAllRoles() public method

public HasAllRoles ( IAuthSession session ) : bool
session IAuthSession
return bool

HasAllRoles() public method

public HasAllRoles ( IRequest req, IAuthSession session, IAuthRepository userAuthRepo = null ) : bool
req IRequest
session IAuthSession
userAuthRepo IAuthRepository
return bool

RequiredRoleAttribute() public method

public RequiredRoleAttribute ( ) : System
return System

RequiredRoleAttribute() public method

public RequiredRoleAttribute ( ApplyTo applyTo ) : System
applyTo ApplyTo
return System