Table of Contents

Class Permission

Namespace
TimeCockpit.Data.Security
Assembly
TimeCockpit.Data.dll

Describes a security permission applied either to a ModelEntity, a ModelProperty, a ModelAction or Model. An instance of Permission is not evaluable in memory, but must be passed to e.g. the StringTemplate compiler. An instance of Permission represents a row-level permission.

public class Permission : ModelElement, IDynamicMetaObjectProvider, INotifyPropertyChanged, IDataErrorInfo
Inheritance
Object
Permission
Implements
IDynamicMetaObjectProvider
INotifyPropertyChanged
IDataErrorInfo
Inherited Members
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()

Constructors

Permission()

Initializes a new instance of the Permission class.

public Permission()

Permission(IEnumerable<KeyValuePair<Object, Object>>)

Initializes a new instance of the Permission class.

public Permission(IEnumerable<KeyValuePair<object, object>> properties)

Parameters

properties IEnumerable<KeyValuePair<Object, Object>>

Collection of properties.

Permission(Permission)

Initializes a new instance of the Permission class.

public Permission(Permission element)

Parameters

element Permission

The element to copy.

Properties

AccessType

Gets or sets the AccessType of the Permission.

public PermissionType AccessType { get; set; }

Property Value

PermissionType

Condition

Gets or sets a TCQL expression that returns either true or false.

public string Condition { get; set; }

Property Value

String

Function

Gets the CLR function for the Permission

public Func<EntityObject, Environment, IEnumerable<QueryParameter>, object> Function { get; }

Property Value

Func<EntityObject, Environment, IEnumerable<QueryParameter>, Object>

Remarks

The function needs the EntityObject on which it should operate as the first parameter.

IsDisabled

Gets or sets a value indicating whether the Permission is disalbed or not.

public bool IsDisabled { get; set; }

Property Value

Boolean

true if this instance is disalbed; otherwise, false.

Message

Gets or sets the message of the Permission.

public string Message { get; set; }

Property Value

String

The message of the Permission.

Methods

Accept(ModelElementVisitor)

Accepts a visitor. Dispatches the correct visit handler in the visitor for the Permission

public override void Accept(ModelElementVisitor visitor)

Parameters

visitor ModelElementVisitor

the visitor to accept.

Validate(ref IList<PropertyValidationMessage>, Boolean)

Validates a ModelElement according to certain rules.

protected override void Validate(ref IList<PropertyValidationMessage> messages, bool validateRecursively)

Parameters

messages IList<PropertyValidationMessage>

An list of strings that stores that picks up the validation errors of a model element.

validateRecursively Boolean

Indicates wheter to validate only the current model element or all its children (recursively) as well.

Remarks

The rules the ModelElement is validated against are dependent on the type of ModelElement that is validated. This method can be overridden to provide custom validation behavior for subclasses of ModelElement

When Validate(ref IList<PropertyValidationMessage>, Boolean) is called on a modelelement, the Validate(ref IList<PropertyValidationMessage>, Boolean) method of all children attatched to the modelelemnt are validated recursivly.