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
Properties
AuthenticationType
public string AuthenticationType { get; }
Property Value
Claims
The claims authorized for the current user, within the context of the current organization.
public ClaimList Claims { get; set; }
Property Value
Groups
Membership within a group is determined by the current organization.
public GroupList Groups { get; set; }
Property Value
HasAccessToAllCompanies
public bool HasAccessToAllCompanies { get; }
Property Value
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
IsAdministrator
public bool IsAdministrator { get; }
Property Value
IsAuthenticated
public bool IsAuthenticated { get; }
Property Value
IsDeveloper
public bool IsDeveloper { get; }
Property Value
IsImpersonating
Returns true if the current user is an administrator impersonating another user.
public bool IsImpersonating { get; }
Property Value
IsOperator
An operator has full access to an organization account, regardless of permissions granted.
public bool IsOperator { get; }
Property Value
Language
The language preference for the session identity.
public string Language { get; }
Property Value
Name
public string Name { get; }
Property Value
Organization
The current organization account selected for the user's current session.
public OrganizationState Organization { get; set; }
Property Value
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
Person
A multi-organization user is a specific person within the context of a specific organization.
public Person Person { get; set; }
Property Value
Persons
A single user account may be represented as a distinct person in more than one organization.
public PersonList Persons { get; set; }
Property Value
RoleIds
public Guid[] RoleIds { get; }
Property Value
- Guid[]
User
The user account for the current session.
public User User { get; set; }
Property Value
UserId
public Guid? UserId { get; }
Property Value
- Guid?
Methods
ChangeLanguage(string)
public string ChangeLanguage(string language)
Parameters
languagestring
Returns
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
languagestringorganizationOrganizationStateorganizationsOrganizationListuserUserimpersonatorImpersonatorpersonPersonpersonsPersonListgroupsGroupListclaimsClaimList
Returns
IsActionAuthorized(string)
public bool IsActionAuthorized(string actionName)
Parameters
actionNamestring
Returns
IsGranted(Guid?)
public bool IsGranted(Guid? action)
Parameters
actionGuid?
Returns
IsGranted(Guid?, PermissionOperation)
public bool IsGranted(Guid? action, PermissionOperation operation)
Parameters
actionGuid?operationPermissionOperation
Returns
IsGranted(string)
public bool IsGranted(string action)
Parameters
actionstring
Returns
IsGranted(string, PermissionOperation)
public bool IsGranted(string action, PermissionOperation operation)
Parameters
actionstringoperationPermissionOperation
Returns
IsInGroup(Guid)
public bool IsInGroup(Guid group)
Parameters
groupGuid
Returns
IsInGroup(string)
public bool IsInGroup(string group)
Parameters
groupstring
Returns
IsInGroup(string[])
public bool IsInGroup(string[] groups)
Parameters
groupsstring[]
Returns
IsInRole(string)
public bool IsInRole(string role)
Parameters
rolestring