Package ndg :: Package xacml :: Package core :: Module policybase :: Class PolicyBase
[hide private]

Class PolicyBase

source code

   object --+    
            |    
XacmlCoreBase --+
                |
               PolicyBase
Known Subclasses:

Nested Classes [hide private]
  __metaclass__
Base class for Policy and PolicySet, each of which can be nested within PolicySets and evaluated with policy combining algorithms.
Instance Methods [hide private]
 
__init__(self)
Element local name check makes this a virtual method
source code
ndg.xacml.core.context.response.Response
evaluateResponse(self, request)
Make an access control decision for the given request based on this policy or policy set, returning a response object.
source code
ndg.xacml.core.context.result.Decision
evaluate(self, context)
Evaluate the decision for this policy or policy set and context.
source code
ndg.xacml.core.context.result.Decision
evaluateCombiningAlgorithm(self, context)
Evaluates the appropriate combining algorithm for this policy or policy set.
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 Methods [hide private]
ndg.xacml.core.policy.Policy
fromSource(cls, source, readerFactory, finder)
Create a new policy or policy set from the input source parsing it using a reader from the required reader factory e.g.
source code
ndg.xacml.core.policy.Policy
fromNestedSource(cls, source, common)
Create a new policy or policy set from the input source parsing it using a reader from the required reader factory e.g.
source code
Class Variables [hide private]
  __abstractmethods__ = frozenset(['evaluateCombiningAlgorithm',...
  _abc_cache = <_weakrefset.WeakSet object at 0x1011d5d50>
  _abc_negative_cache = <_weakrefset.WeakSet object at 0x1011d5dd0>
  _abc_negative_cache_version = 10
  _abc_registry = <_weakrefset.WeakSet object at 0x1011d5c10>

Inherited from XacmlCoreBase: ELEMENT_LOCAL_NAME, XACML_1_0_NS_PREFIX, XACML_2_0_NS_PREFIX, XMLNS

Properties [hide private]
  ident
Subclasses return the identifier appropriate to the class.

Inherited from XacmlCoreBase: elem, isValidXmlns, xmlns

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

Element local name check makes this a virtual method

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

fromSource(cls, source, readerFactory, finder)
Class Method

source code 

Create a new policy or policy set from the input source parsing it using a reader from the required reader factory e.g. ETreeReaderFactory to use ElementTree based parsing.

Parameters:
  • source (string, file, XML node type) - source from which to read the policy - file path, file object, XML node or other dependent on the reader factory selected
  • readerFactory (ndg.xacml.parsers.AbstractReaderFactory) - factory class returns reader class used to parse the policy
  • finder (ndg.xacml.finder.PolicyFinderBase subclass) - policy finder
Returns: ndg.xacml.core.policy.Policy
new policy instance

fromNestedSource(cls, source, common)
Class Method

source code 

Create a new policy or policy set from the input source parsing it using a reader from the required reader factory e.g. ETreeReaderFactory to use ElementTree based parsing.

Parameters:
  • source (string, file, XML node type) - source from which to read the policy - file path, file object, XML node or other dependent on the reader factory selected
  • readerFactory (ndg.xacml.parsers.AbstractReaderFactory) - factory class returns reader class used to parse the policy
Returns: ndg.xacml.core.policy.Policy
new policy instance

evaluateResponse(self, request)

source code 

Make an access control decision for the given request based on this policy or policy set, returning a response object.

Parameters:
  • request (ndg.xacml.core.context.request.Request) - XACML request context
Returns: ndg.xacml.core.context.response.Response
XACML response instance

evaluate(self, context)

source code 

Evaluate the decision for this policy or policy set and context.

Parameters:
  • context (ndg.xacml.core.context.request.Request) - XACML request context
Returns: ndg.xacml.core.context.result.Decision
XACML response instance
Raises:

evaluateCombiningAlgorithm(self, context)

source code 

Evaluates the appropriate combining algorithm for this policy or policy set.

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
Decorators:
  • @abstractmethod

Class Variable Details [hide private]

__abstractmethods__

Value:
frozenset(['evaluateCombiningAlgorithm', 'ident'])

Property Details [hide private]

ident

Subclasses return the identifier appropriate to the class.

Get Method:
unreachable.ident(self) - Subclasses return the identifier appropriate to the class.