Class PrincipalInfoExtensions
Extension methods for EPiServer.Security.PrincipalInfo
Inheritance
Inherited Members
Namespace: Mediachase.Commerce.Security
Assembly: Mediachase.Commerce.dll
Version: 12.17.2Syntax
public static class PrincipalInfoExtensions
Methods
IsAllPermitted(PrincipalInfo, Func<Permissions, IEnumerable<PermissionType>>)
Determains if all of the permission types are permitted.
Declaration
public static bool IsAllPermitted(this PrincipalInfo principalInfo, Func<Permissions, IEnumerable<PermissionType>> permissions)
Parameters
Type | Name | Description |
---|---|---|
EPiServer.Security.PrincipalInfo | principalInfo | The principal info |
System.Func<Permissions, System.Collections.Generic.IEnumerable<EPiServer.Security.PermissionType>> | permissions | The permissions to check |
Returns
Type | Description |
---|---|
System.Boolean |
|
IsAnyPermitted(PrincipalInfo, Func<Permissions, IEnumerable<PermissionType>>)
Determains if any of the permission types are permitted.
Declaration
public static bool IsAnyPermitted(this PrincipalInfo principalInfo, Func<Permissions, IEnumerable<PermissionType>> permissions)
Parameters
Type | Name | Description |
---|---|---|
EPiServer.Security.PrincipalInfo | principalInfo | The principal info |
System.Func<Permissions, System.Collections.Generic.IEnumerable<EPiServer.Security.PermissionType>> | permissions | The permissions to check |
Returns
Type | Description |
---|---|
System.Boolean |
|
IsPermitted(PrincipalInfo, IEnumerable<String>)
Determains if the permission type is permitted.
Declaration
public static bool IsPermitted(this PrincipalInfo principalInfo, IEnumerable<string> permissions)
Parameters
Type | Name | Description |
---|---|---|
EPiServer.Security.PrincipalInfo | principalInfo | The principal info |
System.Collections.Generic.IEnumerable<System.String> | permissions | The permissions to check |
Returns
Type | Description |
---|---|
System.Boolean |
|
IsPermitted(PrincipalInfo, Func<Permissions, PermissionType>)
Determains if the permission type is permitted.
Declaration
public static bool IsPermitted(this PrincipalInfo principalInfo, Func<Permissions, PermissionType> permission)
Parameters
Type | Name | Description |
---|---|---|
EPiServer.Security.PrincipalInfo | principalInfo | The principal info |
System.Func<Permissions, EPiServer.Security.PermissionType> | permission | The permission to check |
Returns
Type | Description |
---|---|
System.Boolean |
|
ValidatePermission(PrincipalInfo, Func<Permissions, PermissionType>)
Throws AccessDeniedException if current principal not permitted.
Declaration
public static void ValidatePermission(this PrincipalInfo principalInfo, Func<Permissions, PermissionType> permission)
Parameters
Type | Name | Description |
---|---|---|
EPiServer.Security.PrincipalInfo | principalInfo | The principal to check permission for. |
System.Func<Permissions, EPiServer.Security.PermissionType> | permission | The permission to check. |
Exceptions
Type | Condition |
---|---|
AccessDeniedException | Thrown if access is denied. |
ValidatePermission(PrincipalInfo, String)
Throws AccessDeniedException if current principal not permitted.
Declaration
public static void ValidatePermission(this PrincipalInfo principalInfo, string permission)
Parameters
Type | Name | Description |
---|---|---|
EPiServer.Security.PrincipalInfo | principalInfo | The principal to check permission for. |
System.String | permission | The permissions to check. |
Exceptions
Type | Condition |
---|---|
AccessDeniedException | Thrown if access is denied. |
ValidatePermissions(PrincipalInfo, IEnumerable<String>)
Throws AccessDeniedException if current principal not permitted.
Declaration
public static void ValidatePermissions(this PrincipalInfo principalInfo, IEnumerable<string> permissions)
Parameters
Type | Name | Description |
---|---|---|
EPiServer.Security.PrincipalInfo | principalInfo | The principal to check permission for. |
System.Collections.Generic.IEnumerable<System.String> | permissions | The permissions to check. |
Exceptions
Type | Condition |
---|---|
AccessDeniedException | Thrown if access is denied. |
ValidatePermissions(PrincipalInfo, Func<Permissions, IEnumerable<PermissionType>>)
Throws AccessDeniedException if current principal not permitted.
Declaration
public static void ValidatePermissions(this PrincipalInfo principalInfo, Func<Permissions, IEnumerable<PermissionType>> permissions)
Parameters
Type | Name | Description |
---|---|---|
EPiServer.Security.PrincipalInfo | principalInfo | The principal to check permission for. |
System.Func<Permissions, System.Collections.Generic.IEnumerable<EPiServer.Security.PermissionType>> | permissions | The permissions to check. |
Exceptions
Type | Condition |
---|---|
AccessDeniedException | Thrown if access is denied. |