source: TI12-security/trunk/NDGSecurity/python/ndg_security_common/ndg/security/common/authz/xacml/attribute.py @ 6643

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg-security/TI12-security/trunk/NDGSecurity/python/ndg_security_common/ndg/security/common/authz/xacml/attribute.py@6643
Revision 6643, 1.1 KB checked in by pjkersha, 11 years ago (diff)

Contd port of MSI Policy + PDP implementation to XACML 2.0

Line 
1'''
2Created on 25 Feb 2010
3
4@author: pjkersha
5'''
6from ndg.security.common.authz.xacml import PolicyComponent
7
8
9class AttributeValue(PolicyComponent):
10    """XACML Attribute Value type"""
11    __slots__ = ('__dataType', '__value')
12   
13    def __init__(self):
14        self.__dataType = None
15        self.__value = None
16       
17    def _get_dataType(self):
18        return self.__dataType
19
20    def _set_dataType(self, value):
21        if not isinstance(value, basestring):
22            raise TypeError('Expecting %r type for "dataType" '
23                            'attribute; got %r' % (basestring, type(value)))
24           
25        self.__dataType = value   
26
27    dataType = property(_get_dataType, _set_dataType, None, 
28                        "attribute value data type") 
29       
30    def _get_value(self):
31        return self.__value
32
33    def _set_value(self, value):
34        if not isinstance(value, basestring):
35            raise TypeError('Expecting %r type for "value" '
36                            'attribute; got %r' % (basestring, type(value)))
37           
38        self.__value = value 
39
40    value = property(_get_value, _set_value, None, "attribute value")   
Note: See TracBrowser for help on using the repository browser.