Table of Contents

Interface IIdentityAccessor

Namespace
Tlabs.Identity
Assembly
Tlabs.Core.dll

Interface of an accessor to informations regarding the current (user) identity.

public interface IIdentityAccessor : IIdentity
Inherited Members
Extension Methods

Properties

Id

Current user id or 0 if anonymous.

int Id { get; }

Property Value

int

Principal

Current (authenticated) user principal or the default based on SysIdentity.

ClaimsPrincipal Principal { get; }

Property Value

ClaimsPrincipal

Roles

Current roles or null if anonymous.

string[] Roles { get; }

Property Value

string[]

Methods

HasRole(string)

Returns true if user is in role.

bool HasRole(string role)

Parameters

role string

Returns

bool