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

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

Started adding parsing for Condition and Apply types.

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 PolicyComponent
13
14
15class Condition(PolicyComponent):
16    """XACML Rule Condition"""
17    ELEMENT_LOCAL_NAME = 'Condition'
18    APPLY_ELEMENT_LOCAL_NAME = 'Apply'
19   
20    __slots__ = ('__expression', )
21   
22    def __init__(self):
23        super(Condition, self).__init__()
24        self.__expression = None
25       
26    @property
27    def expression(self):
28        return self.__expression
29   
30    @expression.setter
31    def expression(self, value):
32        if not isinstance(value, Expression):
33            raise TypeError('Expecting Expression or Expression derived type '
34                            'for "expression" attribute; got %r' %
35                            type(value))
36        self.__expression = value
Note: See TracBrowser for help on using the repository browser.