Table of Contents

Class ProtectedOperation

Namespace
Microsoft.ServiceHub.Framework.Services
Assembly
Microsoft.ServiceHub.Framework.dll

Describes an operation that requires an authorization check.

public class ProtectedOperation : IEquatable<ProtectedOperation>
Inheritance
ProtectedOperation
Implements
Inherited Members

Constructors

ProtectedOperation()

Initializes a new instance of the ProtectedOperation class.

[Obsolete("Use a constructor that initializes the properties instead.")]
public ProtectedOperation()

ProtectedOperation(string)

Initializes a new instance of the ProtectedOperation class.

public ProtectedOperation(string operationMoniker)

Parameters

operationMoniker string

the kind of operation to be performed.

ProtectedOperation(string, int)

Initializes a new instance of the ProtectedOperation class.

public ProtectedOperation(string operationMoniker, int requiredTrustLevel)

Parameters

operationMoniker string

the kind of operation to be performed.

requiredTrustLevel int

the trust level required for the operation.

Properties

OperationMoniker

Gets or sets the kind of operation to be performed.

public string OperationMoniker { get; set; }

Property Value

string

Remarks

This may be a semi-human readable string, and is NOT intended for machine interpretation. Processors of this value should consider it an opaque string.

RequiredTrustLevel

Gets or sets the trust level required for the operation.

public int? RequiredTrustLevel { get; set; }

Property Value

int?

May be null if not applicable (e.g. the OperationMoniker of operation is simply allowed or not, without multiple degrees of trust).

Methods

Equals(ProtectedOperation?)

public virtual bool Equals(ProtectedOperation? other)

Parameters

other ProtectedOperation

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

IsSupersetOf(ProtectedOperation)

Gets a value indicating whether this ProtectedOperation, if granted, implies another ProtectedOperation should also be considered granted.

public virtual bool IsSupersetOf(ProtectedOperation other)

Parameters

other ProtectedOperation

The other operation, which may be a subset of this one.

Returns

bool

true if this instance is a superset of the other; false otherwise.

Remarks

In the base implementation, a superset is considered true if the OperationMoniker is equal and RequiredTrustLevel is equal or a greater value.

See Also