source: TI12-security/trunk/NDG_XACML/ndg/xacml/core/condition.py @ 6770

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/NDG_XACML/ndg/xacml/core/condition.py@6793
Revision 6770, 1.1 KB checked in by pjkersha, 10 years ago (diff)

Added Context Handler and Attribute classes.

Line 
1"""NDG Security Condition type definition
2
3NERC DataGrid Project
4"""
5__author__ = "P J Kershaw"
6__date__ = "25/02/10"
7__copyright__ = "(C) 2010 Science and Technology Facilities Council"
8__contact__ = "Philip.Kershaw@stfc.ac.uk"
9__license__ = "BSD - see LICENSE file in top-level directory"
10__contact__ = "Philip.Kershaw@stfc.ac.uk"
11__revision__ = "$Id: $"
12from ndg.xacml.core import XacmlCoreBase
13from ndg.xacml.core.expression import Expression
14
15
16class Condition(XacmlCoreBase):
17    """XACML Rule Condition"""
18    ELEMENT_LOCAL_NAME = 'Condition'
19    APPLY_ELEMENT_LOCAL_NAME = 'Apply'
20   
21    __slots__ = ('__expression', )
22   
23    def __init__(self):
24        super(Condition, self).__init__()
25        self.__expression = None
26       
27    @property
28    def expression(self):
29        return self.__expression
30   
31    @expression.setter
32    def expression(self, value):
33        if not isinstance(value, Expression):
34            raise TypeError('Expecting Expression or Expression derived type '
35                            'for "expression" attribute; got %r' %
36                            type(value))
37        self.__expression = value
Note: See TracBrowser for help on using the repository browser.