Nucleus .Net Core CMS

Authorization.ClaimsPrincipalExtensions Class

Namespace: Nucleus.Extensions.Authorization
Assembly: Nucleus.Extensions.dll
Extensions used to access the current user's claims.
GetUserClaim<T> (ClaimsPrincipal user, String nameIdentifier)
Retrieve the specified claim from the user (claims principal)
Type Parameters
T Type to return.
Parameters
Name Type
user System.Security.Claims.ClaimsPrincipal
nameIdentifier String
GetUserId (ClaimsPrincipal user)
Retrieve the name identifier claim from the user (claims principal)
Parameters
Name Type
user System.Security.Claims.ClaimsPrincipal
Remarks
The name identifier is the User Id from the Users table.
IsAnonymous (ClaimsPrincipal user)
Retrieve a true/false value indicating whether the user (claims principal) is anonymous (not logged on).
Parameters
Name Type
user System.Security.Claims.ClaimsPrincipal
IsApproved (ClaimsPrincipal user)
Retrieve a true/false value indicating whether the user (claims principal) account has been approved.
Parameters
Name Type
user System.Security.Claims.ClaimsPrincipal
IsPasswordExpired (ClaimsPrincipal user)
Retrieve a true/false value indicating whether the user (claims principal) password has expired.
Parameters
Name Type
user System.Security.Claims.ClaimsPrincipal
IsSiteAdmin (ClaimsPrincipal user, Site site)
Retrieve a true/false value indicating whether the user (claims principal) is a site administrator or system administrator.
IsSystemAdministrator (ClaimsPrincipal user)
Retrieve a true/false value indicating whether the user (claims principal) is a system administrator.
Parameters
Name Type
user System.Security.Claims.ClaimsPrincipal
IsVerified (ClaimsPrincipal user)
Retrieve a true/false value indicating whether the user (claims principal) account has been verified.
Parameters
Name Type
user System.Security.Claims.ClaimsPrincipal