source: TI12-security/trunk/NDG_XACML/ndg/xacml/core/context/subject.py @ 6771

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

Added request subject, resource, action and environment types

Line 
1"""NDG XACML Context Subject type
2
3NERC DataGrid Project
4"""
5__author__ = "P J Kershaw"
6__date__ = "24/03/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.context import RequestChildBase
13
14
15class Subject(RequestChildBase):
16    """XACML Context Subject type"""
17    ELEMENT_LOCAL_NAME = 'Subject'
18    SUBJECT_CATEGORY_ATTRIB_NAME = 'SubjectCategory'
19   
20    __slots__ = ('__subjectCategory',)
21   
22    def __init__(self):
23        super(Subject, self).__init__()
24        self.__subjectCategory = None
25
26    def _get_subjectCategory(self):
27        return self.__subjectCategory
28
29    def _set_subjectCategory(self, value):
30        if not isinstance(value, basestring):
31            raise TypeError('Expecting %r type for "subjectCategory" '
32                            'attribute; got %r' % (basestring, type(value)))
33           
34        self.__subjectCategory = value   
35
36    subjectCategory = property(_get_subjectCategory, _set_subjectCategory, None, 
37                               "Subject category")
Note: See TracBrowser for help on using the repository browser.