Class SecurityEntity
Simple immutable class that identifies a security entity, i e a user or a role.
Inheritance
Namespace: EPiServer.Security
Assembly: EPiServer.Framework.dll
Version: 12.0.3Syntax
public class SecurityEntity : Object
Constructors
SecurityEntity(String)
Initializes a new instance of the Security
Declaration
public SecurityEntity(string name)
Parameters
Type | Name | Description |
---|---|---|
System. |
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 Security
Declaration
public SecurityEntity(string name, SecurityEntityType entityType)
Parameters
Type | Name | Description |
---|---|---|
System. |
name | The name of the security entity. |
Security |
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 |
---|---|
Security |
Name
Gets the name of the security entity.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
System. |
Methods
ToString()
Returns a System.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System. |
A System. |
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. |
securityEntity | The string representation of a security entity. |
Security |
entity | The parsed entity. |
Returns
Type | Description |
---|---|
System. |
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