Class IdentityExtensions
An identity extensions.
Inheritance
System.Object
IdentityExtensions
Namespace: Cireson.Core.Common.Extensions
Assembly: Cireson.Core.Common.dll
Syntax
public static class IdentityExtensions : object
Remarks
Admin, 8/24/2017.
Methods
View SourceGetRoles(IIdentity)
An IIdentity extension method that gets the roles.
Declaration
public static IList<string> GetRoles(this IIdentity identity)
Parameters
Type | Name | Description |
---|---|---|
IIdentity | identity | The identity to act on. |
Returns
Type | Description |
---|---|
IList<System.String> | The roles. |
Remarks
Admin, 8/24/2017.
HasRole(IIdentity, IList<String>)
An IIdentity extension method that query if 'identity' has role.
Declaration
public static bool HasRole(this IIdentity identity, IList<string> roles)
Parameters
Type | Name | Description |
---|---|---|
IIdentity | identity | The identity to act on. |
IList<System.String> | roles | The roles. |
Returns
Type | Description |
---|---|
System.Boolean | True if role, false if not. |
Remarks
Admin, 8/24/2017.
HasRole(IIdentity, String)
An IIdentity extension method that query if 'identity' has role.
Declaration
public static bool HasRole(this IIdentity identity, string role)
Parameters
Type | Name | Description |
---|---|---|
IIdentity | identity | The identity to act on. |
System.String | role | The role. |
Returns
Type | Description |
---|---|
System.Boolean | True if role, false if not. |
Remarks
Admin, 8/24/2017.
IsClaimMatch(Claim, String)
A Claim extension method that query if 'claim1' is claim match.
Declaration
public static bool IsClaimMatch(this Claim claim1, string claim2)
Parameters
Type | Name | Description |
---|---|---|
Claim | claim1 | The claim1 to act on. |
System.String | claim2 | The second claim. |
Returns
Type | Description |
---|---|
System.Boolean | True if claim match, false if not. |
Remarks
Admin, 8/24/2017.