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

Class SecurityEntity

Simple immutable class that identifies a security entity, i e a user or a role.

Inheritance
System.Object
SecurityEntity
Inherited Members
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: EPiServer.Security
Assembly: EPiServer.Framework.dll
Version: 11.20.7
Syntax
public class SecurityEntity

Constructors

SecurityEntity(String)

Initializes a new instance of the SecurityEntity class.

Declaration
public SecurityEntity(string name)
Parameters
Type Name Description
System.String name

The name of the security entity.

Remarks

By default the entity will be marked as a role.

SecurityEntity(String, SecurityEntityType)

Initializes a new instance of the SecurityEntity class.

Declaration
public SecurityEntity(string name, SecurityEntityType entityType)
Parameters
Type Name Description
System.String name

The name of the security entity.

SecurityEntityType entityType

Type of the entity.

Remarks

A security entity can be a role or a user.

Properties

EntityType

Gets the type of the entity.

Declaration
public SecurityEntityType EntityType { get; }
Property Value
Type Description
SecurityEntityType

Name

Gets the name of the security entity.

Declaration
public string Name { get; }
Property Value
Type Description
System.String

Methods

ToString()

Returns a System.String that represents the current System.Object.

Declaration
public override string ToString()
Returns
Type Description
System.String

A System.String that represents the current System.Object.

Overrides
System.Object.ToString()
Remarks

The string returned by ToString can always be successfully parsed with the TryParse method.

TryParse(String, out SecurityEntity)

Tries to parse a string into a SecurityEntity.

Declaration
public static bool TryParse(string securityEntity, out SecurityEntity entity)
Parameters
Type Name Description
System.String securityEntity

The string representation of a security entity.

SecurityEntity entity

The parsed entity.

Returns
Type Description
System.Boolean

True if the string was successfully parsed; false otherwise.

Remarks

The expected format is:

SecurityEntityType:Name

I e the following are all valid strings that can be successfully parsed:

User:Adam Role:Administrator User:superuser

Extension Methods