CSLA.NET 6.0.0
CSLA .NET is a software development framework that helps you build a reusable, maintainable object-oriented business layer for your app.
Csla.Rules.AuthorizationRule Class Referenceabstract

Base class providing basic authorization rule implementation. More...

Inheritance diagram for Csla.Rules.AuthorizationRule:
Csla.Rules.IAuthorizationRule Csla.Rules.CommonRules.IsInRole Csla.Rules.CommonRules.IsNotInRole Csla.Test.Authorization.AuthRuleExpectsCriteria

Public Member Functions

 AuthorizationRule (AuthorizationActions action)
 Creates an instance of the rule. More...
 
 AuthorizationRule (AuthorizationActions action, Csla.Core.IMemberInfo element)
 Creates an instance of the rule. More...
 

Protected Member Functions

abstract void Execute (IAuthorizationContext context)
 Authorization rule implementation. More...
 
object ReadProperty (object obj, Csla.Core.IPropertyInfo propertyInfo)
 Reads a property's field value. More...
 

Properties

bool CacheResult [getprotected set]
 Gets a value indicating whether the results of this rule can be cached at the business object level. More...
 
Csla.Core.IMemberInfo Element [getset]
 Gets the name of the element (property/method) to which this rule is associated. More...
 
AuthorizationActions Action [getset]
 Gets the authorization action this rule will enforce. More...
 
- Properties inherited from Csla.Rules.IAuthorizationRule
Csla.Core.IMemberInfo Element [get]
 Gets the element (property/method) to which this rule is associated. More...
 
AuthorizationActions Action [get]
 Gets the authorization action this rule will enforce. More...
 
bool CacheResult [get]
 Gets a value indicating whether the results of this rule can be cached at the business object level. More...
 

Detailed Description

Base class providing basic authorization rule implementation.

Definition at line 20 of file AuthorizationRule.cs.

Constructor & Destructor Documentation

◆ AuthorizationRule() [1/2]

Csla.Rules.AuthorizationRule.AuthorizationRule ( AuthorizationActions  action)

Creates an instance of the rule.

Parameters
actionAction this rule will enforce.

Definition at line 31 of file AuthorizationRule.cs.

◆ AuthorizationRule() [2/2]

Csla.Rules.AuthorizationRule.AuthorizationRule ( AuthorizationActions  action,
Csla.Core.IMemberInfo  element 
)

Creates an instance of the rule.

Parameters
actionAction this rule will enforce.
elementMethod or property.

Definition at line 40 of file AuthorizationRule.cs.

Member Function Documentation

◆ Execute()

abstract void Csla.Rules.AuthorizationRule.Execute ( IAuthorizationContext  context)
protectedpure virtual

Authorization rule implementation.

Parameters
contextRule context object.

Implements Csla.Rules.IAuthorizationRule.

Implemented in Csla.Test.Authorization.AuthRuleExpectsCriteria, Csla.Rules.CommonRules.IsInRole, and Csla.Rules.CommonRules.IsNotInRole.

◆ ReadProperty()

object Csla.Rules.AuthorizationRule.ReadProperty ( object  obj,
Csla.Core.IPropertyInfo  propertyInfo 
)
protected

Reads a property's field value.

Parameters
objObject on which to call the method.
propertyInfoPropertyInfo object containing property metadata.

No authorization checks occur when this method is called.

Definition at line 138 of file AuthorizationRule.cs.

Property Documentation

◆ Action

AuthorizationActions Csla.Rules.AuthorizationRule.Action
getset

Gets the authorization action this rule will enforce.

Definition at line 85 of file AuthorizationRule.cs.

◆ CacheResult

bool Csla.Rules.AuthorizationRule.CacheResult
getprotected set

Gets a value indicating whether the results of this rule can be cached at the business object level.

Returns
bool, true by default to allow cache result.

Definition at line 58 of file AuthorizationRule.cs.

◆ Element

Csla.Core.IMemberInfo Csla.Rules.AuthorizationRule.Element
getsetprotected

Gets the name of the element (property/method) to which this rule is associated.

Definition at line 72 of file AuthorizationRule.cs.