Package ndg :: Package xacml :: Package core :: Module rule :: Class Rule
[hide private]

Class Rule

source code

   object --+    
            |    
XacmlCoreBase --+
                |
               Rule

XACML Policy Rule

Instance Methods [hide private]
 
__init__(self)
Initialise attributes
source code
ndg.xacml.core.condition.Condition / NoneType
_get_id(self)
Get rule ID
source code
 
_set_id(self, value)
Set rule ID
source code
ndg.xacml.core.rule.Effect / NoneType
_get_effect(self)
Get rule effect
source code
 
_set_effect(self, value)
Set rule effect
source code
basestring / NoneType
_getDescription(self)
Get rule description
source code
 
_setDescription(self, value)
Set rule description
source code
ndg.xacml.core.context.result.Decision
evaluate(self, context)
Evaluate a rule
source code

Inherited from XacmlCoreBase: __getstate__

Inherited from XacmlCoreBase (private): _getXmlns, _setXmlns

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
NoneType but implement as string in derived classes ELEMENT_LOCAL_NAME = 'Rule'
XML element local name for the given type
string RULE_ID_ATTRIB_NAME = 'RuleId'
rule id XML attribute name
string EFFECT_ATTRIB_NAME = 'Effect'
effect XML attribute name
string DESCRIPTION_LOCAL_NAME = 'Description'
XML local name for the description element

Inherited from XacmlCoreBase: XACML_1_0_NS_PREFIX, XACML_2_0_NS_PREFIX, XMLNS

Instance Variables [hide private]
ndg.xacml.core.condition.Condition / NoneType __condition
rule condition
basestring / NoneType __description
rule description text
ndg.xacml.core.rule.Effect / NoneType __effect
rule effect
basestring / NoneType __id
rule ID
ndg.xacml.core.target.Target / NoneType __target
rule target
Properties [hide private]
ndg.xacml.core.target import Target / NoneType target
Get Rule target
ndg.xacml.core.condition.Condition / NoneType condition
Get rule condition
  id
Rule identifier attribute
  effect
Rule effect attribute
  description
Rule Description text

Inherited from XacmlCoreBase: elem, isValidXmlns, xmlns

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

Initialise attributes

Raises:
  • NotImplementedError - derived classes must set ELEMENT_LOCAL_NAME to a string
Overrides: object.__init__

_get_id(self)

source code 

Get rule ID

Returns: ndg.xacml.core.condition.Condition / NoneType
rule ID

_set_id(self, value)

source code 

Set rule ID

Parameters:
  • value (basestring) - rule ID
Raises:
  • TypeError - incorrect type set

_get_effect(self)

source code 

Get rule effect

Returns: ndg.xacml.core.rule.Effect / NoneType
rule effect

_set_effect(self, value)

source code 

Set rule effect

Parameters:
  • value (ndg.xacml.core.rule.Effect) - rule effect
Raises:
  • TypeError - incorrect type set

_getDescription(self)

source code 

Get rule description

Returns: basestring / NoneType
rule description

_setDescription(self, value)

source code 

Set rule description

Parameters:
  • value (basestring) - rule description
Raises:
  • TypeError - incorrect type set

evaluate(self, context)

source code 

Evaluate a rule

Parameters:
  • context (ndg.xacml.core.request.Request) - the request context
Returns: ndg.xacml.core.context.result.Decision
result of the evaluation - the decision for this rule

Property Details [hide private]

target

Get Rule target

Get Method:
unreachable.target(self) - Get Rule target
Set Method:
unreachable.target(self, value) - Set rule target
Type:
ndg.xacml.core.target import Target / NoneType

condition

Get rule condition

Get Method:
unreachable.condition(self) - Get rule condition
Set Method:
unreachable.condition(self, value) - Set rule condition
Type:
ndg.xacml.core.condition.Condition / NoneType

id

Rule identifier attribute

Get Method:
_get_id(self) - Get rule ID
Set Method:
_set_id(self, value) - Set rule ID

effect

Rule effect attribute

Get Method:
_get_effect(self) - Get rule effect
Set Method:
_set_effect(self, value) - Set rule effect

description

Rule Description text

Get Method:
_getDescription(self) - Get rule description
Set Method:
_setDescription(self, value) - Set rule description