Class FieldRight
Wraps the field right together with an explanatory reason. Also adds logical operators to the field rights so that they can be easily combined.
Implements
Inherited Members
Namespace: SuperOffice.CRM.Security
Assembly: SoCore.dll
Syntax
public sealed class FieldRight : ItemRight, ICloneable
Remarks
Usually obtained from the SuperOffice.CRM.Security.RightsFactory rather than created directly by the client.
Constructors
FieldRight()
Create a blank field-right with no permissions.
Declaration
public FieldRight()
FieldRight(EFieldRight)
Create a field right with the given permission.
Declaration
public FieldRight(EFieldRight right)
Parameters
Type | Name | Description |
---|---|---|
EFieldRight | right | Bitflag of field permissions |
FieldRight(EFieldRight, String)
Create a field right with the given permission.
Declaration
public FieldRight(EFieldRight right, string theReason)
Parameters
Type | Name | Description |
---|---|---|
EFieldRight | right | Bitflag of field permissions |
String | theReason | Description of why permissions are restricted |
Properties
CanUIRead
Can this field be read in the user interface.
Declaration
public bool CanUIRead { get; }
Property Value
Type | Description |
---|---|
Boolean |
CanUIUpdate
Can this field be updated in the user interface.
Declaration
public bool CanUIUpdate { get; }
Property Value
Type | Description |
---|---|
Boolean |
HasAll
Returns true when all of Read, Write permissions are available. Required permissions are ignored. Equivalent to the IsActive property.
Declaration
public override bool HasAll { get; }
Property Value
Type | Description |
---|---|
Boolean |
Overrides
HasNone
Returns true when no permissions are available. No read, write or required permissions.
Declaration
public override bool HasNone { get; }
Property Value
Type | Description |
---|---|
Boolean |
Overrides
IgnoreReason
Declaration
protected override bool IgnoreReason { get; }
Property Value
Type | Description |
---|---|
Boolean |
Overrides
IsActive
Returns true when the field is editable. (Read+Write permissions). Equivalent to the HasAll property.
Declaration
public override bool IsActive { get; }
Property Value
Type | Description |
---|---|
Boolean |
Overrides
IsMandatory
Returns true when the field must be filled out.
Declaration
public bool IsMandatory { get; }
Property Value
Type | Description |
---|---|
Boolean |
IsUIMandatory
Is it mandatory to fill in htis field in the user interface.
Declaration
public bool IsUIMandatory { get; }
Property Value
Type | Description |
---|---|
Boolean |
IsVisible
Returns true when the field is readable.
Declaration
public bool IsVisible { get; }
Property Value
Type | Description |
---|---|
Boolean |
Mask
Returns the bitflag of permissions.
Declaration
public EFieldRight Mask { get; }
Property Value
Type | Description |
---|---|
EFieldRight |
Methods
And(EFieldRight, EFieldRight)
Combine two field rights returning the intersection of the two rights.
Declaration
public static EFieldRight And(EFieldRight r1, EFieldRight r2)
Parameters
Type | Name | Description |
---|---|---|
EFieldRight | r1 | The first right. |
EFieldRight | r2 | The second right. |
Returns
Type | Description |
---|---|
EFieldRight | The resulting right. |
Remarks
Read and Writhe rights are ANDed and UIHints are ORed
CanDo(EFieldRight)
Return true if the any of the specified permissions are active.
Declaration
public bool CanDo(EFieldRight right)
Parameters
Type | Name | Description |
---|---|---|
EFieldRight | right | Bitflag of permissions |
Returns
Type | Description |
---|---|
Boolean | True if any of the bits in the parameter are set in this right. |
CanDoAll(EFieldRight)
Return true if all of the specified permissions are active.
Declaration
public bool CanDoAll(EFieldRight right)
Parameters
Type | Name | Description |
---|---|---|
EFieldRight | right | Bitflag of permissions |
Returns
Type | Description |
---|---|
Boolean | True if all of the bits in the parameter are set in this right |
Clone()
Return a new instance of the field right object.
Declaration
public object Clone()
Returns
Type | Description |
---|---|
Object | Copy of the field right |
DemandAllRights(EFieldRight)
Test the permissions and throw a SoSentryException if not all of the specified rights are set.
Declaration
public void DemandAllRights(EFieldRight right)
Parameters
Type | Name | Description |
---|---|---|
EFieldRight | right | Bitflag of rights |
DemandRight(EFieldRight)
Test the permissions and throw a SoSentryException if none of the specified rights are set.
Declaration
public void DemandRight(EFieldRight right)
Parameters
Type | Name | Description |
---|---|---|
EFieldRight | right | Bitflag |
Or(EFieldRight, EFieldRight)
Combine two field rights rturning the union of the two rights.
Declaration
public static EFieldRight Or(EFieldRight r1, EFieldRight r2)
Parameters
Type | Name | Description |
---|---|---|
EFieldRight | r1 | The first right. |
EFieldRight | r2 | The second right. |
Returns
Type | Description |
---|---|
EFieldRight | The resulting right. |
Remarks
Read and Writhe rights are ORed and UIHints are ANDed
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |
Overrides
Operators
BitwiseAnd(FieldRight, FieldRight)
Declaration
public static FieldRight operator &(FieldRight f1, FieldRight f2)
Parameters
Type | Name | Description |
---|---|---|
FieldRight | f1 | |
FieldRight | f2 |
Returns
Type | Description |
---|---|
FieldRight |
BitwiseOr(FieldRight, FieldRight)
Declaration
public static FieldRight operator |(FieldRight f1, FieldRight f2)
Parameters
Type | Name | Description |
---|---|---|
FieldRight | f1 | |
FieldRight | f2 |
Returns
Type | Description |
---|---|
FieldRight |