Class PermissionEntity
Encapsulates functionality to associate a principal and a permissions set.
Inheritance
System.Object
PermissionEntity
Implements
Namespace: Microsoft.GNS.Roster.Internal
Assembly: Microsoft.GNS.Roster.Internal.dll
Syntax
public sealed class PermissionEntity : object, IPermissionEntity
Constructors
View SourcePermissionEntity()
Initializes a new instance of the PermissionEntity class.
Declaration
public PermissionEntity()
PermissionEntity(IRosterPrincipal, PermissionFlags)
Initializes a new instance of the PermissionEntity class.
Declaration
public PermissionEntity(IRosterPrincipal principal, PermissionFlags permissions)
Parameters
Type | Name | Description |
---|---|---|
IRosterPrincipal | principal | The principal to permission. |
PermissionFlags | permissions | The permissions. |
Fields
View SourceEmpty
Represents an empty or unset version of this object.
Declaration
public static readonly PermissionEntity Empty
Field Value
Type | Description |
---|---|
PermissionEntity |
Properties
View SourcePermissions
Gets or sets the permissions flags.
Declaration
public PermissionFlags Permissions { get; set; }
Property Value
Type | Description |
---|---|
PermissionFlags |
Principal
Gets the principal in which to set permissions.
Declaration
public IRosterPrincipal Principal { get; }
Property Value
Type | Description |
---|---|
IRosterPrincipal |
Methods
View SourceEquals(Nullable<Object>)
Declaration
public override bool Equals(object? obj)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.Object> | obj |
Returns
Type | Description |
---|---|
System.Boolean |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
HasPermission(PermissionFlags)
Checks for a specific permission by integer value.
Declaration
public bool HasPermission(PermissionFlags value)
Parameters
Type | Name | Description |
---|---|---|
PermissionFlags | value | The permission value to check. |
Returns
Type | Description |
---|---|
System.Boolean | True if the principal has the permission. Otherwise false. |
PossiblePermissions()
Gets a list of possible permissions.
Declaration
public static IEnumerable<PermissionFlags> PossiblePermissions()
Returns
Type | Description |
---|---|
IEnumerable<PermissionFlags> | A list of possible permissions. |