Show / Hide Table of Contents

Class TableRight

Wraps a table right together with an explanatory reason. Code can indicate why access is restricted.

Inheritance
Object
GenericRight
TableRight
Inherited Members
GenericRight._reason
GenericRight.Reason
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Namespace: SuperOffice.CRM.Security
Assembly: SoCore.dll
Syntax
public class TableRight : GenericRight
Remarks

Usually obtained from the SuperOffice.CRM.Security.RightsFactory rather than created directly by the client.

Constructors

TableRight()

Creates a blank table right with no rights.

Declaration
public TableRight()

TableRight(ETableRight)

Create a table right with the given set of permissions.

Declaration
public TableRight(ETableRight right)
Parameters
Type Name Description
ETableRight right

A bitflag of table permissions

TableRight(ETableRight, String)

Create a table right with the given set of permissions and the given reason.

Declaration
public TableRight(ETableRight right, string theReason)
Parameters
Type Name Description
ETableRight right

Bitflag of table permissions

String theReason

Description of why permissions are restricted

Fields

_mask

Declaration
protected ETableRight _mask
Field Value
Type Description
ETableRight

Properties

HasAll

Returns true when all of Read, Insert, Delete, Update permissions are available. Filter and RestrictedUpdate permissions are ignored.

Declaration
public override bool HasAll { get; }
Property Value
Type Description
Boolean
Overrides
GenericRight.HasAll

HasDelete

Returns true if the ETableRight.Delete permission is active.

Declaration
public bool HasDelete { get; }
Property Value
Type Description
Boolean

HasInsert

Returns true if the ETableRight.Insert permission is active.

Declaration
public bool HasInsert { get; }
Property Value
Type Description
Boolean

HasNone

Returns true when no permissions are available. Filter or RestrictedUpdate permissions mean that HasNone would return false.

Declaration
public override bool HasNone { get; }
Property Value
Type Description
Boolean
Overrides
GenericRight.HasNone

HasRead

Returns true if the ETableRight.Read or ETableRight.FilteredRead permission is active.

Declaration
public bool HasRead { get; }
Property Value
Type Description
Boolean

HasReadFiltered

Declaration
public bool HasReadFiltered { get; }
Property Value
Type Description
Boolean

HasUpdate

Returns true if the ETableRight.Update or ETableRight.RestrictedUpdate permission is active.

Declaration
public bool HasUpdate { get; }
Property Value
Type Description
Boolean

IgnoreReason

Declaration
protected override bool IgnoreReason { get; }
Property Value
Type Description
Boolean
Overrides
GenericRight.IgnoreReason

IsUpdateRestricted

Declaration
public bool IsUpdateRestricted { get; }
Property Value
Type Description
Boolean

Mask

Returns the bitflag of permissions.

Declaration
public ETableRight Mask { get; }
Property Value
Type Description
ETableRight

Methods

Add(ETableRight, ETableRight)

Perform a logical or operation between the two rights.

Declaration
public static ETableRight Add(ETableRight r1, ETableRight r2)
Parameters
Type Name Description
ETableRight r1

First Right

ETableRight r2

Second Right

Returns
Type Description
ETableRight

The resulting right

Remarks

The operation implements the rules required for ETableRight.

And(ETableRight, ETableRight)

Perform a logical And operation between the two rights.

Declaration
public static ETableRight And(ETableRight r1, ETableRight r2)
Parameters
Type Name Description
ETableRight r1

First Right

ETableRight r2

Second Right

Returns
Type Description
ETableRight

The resulting right

Remarks

The operation implements the rules required for ETableRight.

CanDelete(ETableRight)

Declaration
public static bool CanDelete(ETableRight observed)
Parameters
Type Name Description
ETableRight observed
Returns
Type Description
Boolean

CanDo(ETableRight)

Returns true when one or more of the given permissions are available.

Declaration
public bool CanDo(ETableRight right)
Parameters
Type Name Description
ETableRight right

Bitflag of permissions

Returns
Type Description
Boolean

True when any of the flags are set

CanDoAll(ETableRight)

Returns true when all the given permissions are available.

Declaration
public bool CanDoAll(ETableRight right)
Parameters
Type Name Description
ETableRight right

Bitflag of permissions

Returns
Type Description
Boolean

True when all the flags are set

CanInsert(ETableRight)

Declaration
public static bool CanInsert(ETableRight observed)
Parameters
Type Name Description
ETableRight observed
Returns
Type Description
Boolean

CanRead(ETableRight)

Declaration
public static bool CanRead(ETableRight observed)
Parameters
Type Name Description
ETableRight observed
Returns
Type Description
Boolean

CanUpdate(ETableRight)

Declaration
public static bool CanUpdate(ETableRight observed)
Parameters
Type Name Description
ETableRight observed
Returns
Type Description
Boolean

CanUpdateSome(ETableRight)

Declaration
public static bool CanUpdateSome(ETableRight observed)
Parameters
Type Name Description
ETableRight observed
Returns
Type Description
Boolean

DemandAllRights(ETableRight)

Test the permissions and throw a SoSentryException if not all of the permissions are available. CanDoAll(ETableRight)

Declaration
public void DemandAllRights(ETableRight right)
Parameters
Type Name Description
ETableRight right

Bitflag of permissions

DemandRight(ETableRight)

Test the permissions and throw a SoSentryException if none of the permissions are available. CanDo(ETableRight)

Declaration
public void DemandRight(ETableRight right)
Parameters
Type Name Description
ETableRight right

Bitflag of permissions

HasAllRightBits(ETableRight, ETableRight)

Declaration
public static bool HasAllRightBits(ETableRight observed, ETableRight required)
Parameters
Type Name Description
ETableRight observed
ETableRight required
Returns
Type Description
Boolean

HasSomeRightBits(ETableRight, ETableRight)

Declaration
public static bool HasSomeRightBits(ETableRight observed, ETableRight required)
Parameters
Type Name Description
ETableRight observed
ETableRight required
Returns
Type Description
Boolean

IsReadFiltered(ETableRight)

Declaration
public static bool IsReadFiltered(ETableRight observed)
Parameters
Type Name Description
ETableRight observed
Returns
Type Description
Boolean

Or(ETableRight, ETableRight)

Perform a logical Or operation between the two rights.

Declaration
public static ETableRight Or(ETableRight r1, ETableRight r2)
Parameters
Type Name Description
ETableRight r1

First Right

ETableRight r2

Second Right

Returns
Type Description
ETableRight

The resulting right

Remarks

The operation implements the rules required for ETableRight.

RawAnd(TableRight)

Declaration
public TableRight RawAnd(TableRight right)
Parameters
Type Name Description
TableRight right
Returns
Type Description
TableRight

Subtract(ETableRight, ETableRight)

Perform a logical And operation between the two rights.

Declaration
public static ETableRight Subtract(ETableRight r1, ETableRight r2)
Parameters
Type Name Description
ETableRight r1

First Right

ETableRight r2

Second Right

Returns
Type Description
ETableRight

The resulting right

Remarks

The operation implements the rules required for ETableRight. This can be logically illustrated as <c>r1 & ~r2</c>.

ToString()

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

ToString(String)

Declaration
public string ToString(string prefix)
Parameters
Type Name Description
String prefix
Returns
Type Description
String

Operators

BitwiseAnd(TableRight, TableRight)

Combine two table-rights into one. Permissions are logically ANDed together, giving us the lowest common denominator results.

Declaration
public static TableRight operator &(TableRight f1, TableRight f2)
Parameters
Type Name Description
TableRight f1
TableRight f2
Returns
Type Description
TableRight

BitwiseOr(TableRight, TableRight)

Combine two table-rights into one using logical OR.

Declaration
public static TableRight operator |(TableRight f1, TableRight f2)
Parameters
Type Name Description
TableRight f1
TableRight f2
Returns
Type Description
TableRight

New right with combined mask and reason

Extension Methods

EnumUtil.MapEnums<From, To>(From)
ObjectExtensions.AssignByReflection<T>(T, T)
ObjectExtensions.GraphCopy<T>(T)
Converters.MapEnums<From, To>(From)
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top