Table of Contents

Class CurrentIdentity

Namespace
InSite.Domain.Foundations
Assembly
Shift.Sdk.dll

This class represents the user/organization identity for a session. It is intended as a Data Transfer Object class only, therefore it has no methods except the methods required to implement IPrincipal.

public class CurrentIdentity : ISecurityFramework, IIdentity, IPrincipal, ISimplePrincipal
Inheritance
CurrentIdentity
Implements
Inherited Members
Extension Methods

Constructors

CurrentIdentity()

The default constructor creates an empty list for each collection. Disallow construction from outside this class.

public CurrentIdentity()

Fields

PortalActionIdentifier

public static readonly Guid PortalActionIdentifier

Field Value

Guid

Properties

AuthenticationType

public string AuthenticationType { get; }

Property Value

string

Claims

The claims authorized for the current user, within the context of the current organization.

public ClaimList Claims { get; set; }

Property Value

ClaimList

Groups

Membership within a group is determined by the current organization.

public GroupList Groups { get; set; }

Property Value

GroupList

HasAccessToAllCompanies

public bool HasAccessToAllCompanies { get; }

Property Value

bool

Impersonator

If the user is being impersonated by an administrator, this identifies the administrator who is doing the impersonation.

public Impersonator Impersonator { get; set; }

Property Value

Impersonator

IsAdministrator

public bool IsAdministrator { get; }

Property Value

bool

IsAuthenticated

public bool IsAuthenticated { get; }

Property Value

bool

IsDeveloper

public bool IsDeveloper { get; }

Property Value

bool

IsImpersonating

Returns true if the current user is an administrator impersonating another user.

public bool IsImpersonating { get; }

Property Value

bool

IsOperator

An operator has full access to an organization account, regardless of permissions granted.

public bool IsOperator { get; }

Property Value

bool

Language

The language preference for the session identity.

public string Language { get; }

Property Value

string

Name

public string Name { get; }

Property Value

string

Organization

The current organization account selected for the user's current session.

public OrganizationState Organization { get; set; }

Property Value

OrganizationState

OrganizationId

public Guid? OrganizationId { get; }

Property Value

Guid?

Organizations

The organization accounts to which the user has access.

public OrganizationList Organizations { get; set; }

Property Value

OrganizationList

Person

A multi-organization user is a specific person within the context of a specific organization.

public Person Person { get; set; }

Property Value

Person

Persons

A single user account may be represented as a distinct person in more than one organization.

public PersonList Persons { get; set; }

Property Value

PersonList

RoleIds

public Guid[] RoleIds { get; }

Property Value

Guid[]

User

The user account for the current session.

public User User { get; set; }

Property Value

User

UserId

public Guid? UserId { get; }

Property Value

Guid?

Methods

ChangeLanguage(string)

public string ChangeLanguage(string language)

Parameters

language string

Returns

string

Create(string, OrganizationState, OrganizationList, User, Impersonator, Person, PersonList, GroupList, ClaimList)

public static CurrentIdentity Create(string language, OrganizationState organization, OrganizationList organizations, User user, Impersonator impersonator, Person person, PersonList persons, GroupList groups, ClaimList claims)

Parameters

language string
organization OrganizationState
organizations OrganizationList
user User
impersonator Impersonator
person Person
persons PersonList
groups GroupList
claims ClaimList

Returns

CurrentIdentity

IsActionAuthorized(string)

public bool IsActionAuthorized(string actionName)

Parameters

actionName string

Returns

bool

IsGranted(Guid?)

public bool IsGranted(Guid? action)

Parameters

action Guid?

Returns

bool

IsGranted(Guid?, PermissionOperation)

public bool IsGranted(Guid? action, PermissionOperation operation)

Parameters

action Guid?
operation PermissionOperation

Returns

bool

IsGranted(string)

public bool IsGranted(string action)

Parameters

action string

Returns

bool

IsGranted(string, PermissionOperation)

public bool IsGranted(string action, PermissionOperation operation)

Parameters

action string
operation PermissionOperation

Returns

bool

IsInGroup(Guid)

public bool IsInGroup(Guid group)

Parameters

group Guid

Returns

bool

IsInGroup(string)

public bool IsInGroup(string group)

Parameters

group string

Returns

bool

IsInGroup(string[])

public bool IsInGroup(string[] groups)

Parameters

groups string[]

Returns

bool

IsInRole(string)

public bool IsInRole(string role)

Parameters

role string

Returns

bool