November Happy Hour will be moved to Thursday December 5th.

Class PrincipalInfoExtensions

Extension methods for EPiServer.Security.PrincipalInfo

Inheritance
System.Object
PrincipalInfoExtensions
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Mediachase.Commerce.Security
Assembly: Mediachase.Commerce.dll
Version: 13.30.0
Syntax
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

True if all permitted, otherwise false.

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

True if all permitted, otherwise false.

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

True if all permitted, otherwise false.

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

True if all permitted, otherwise false.

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.