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

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

Added request subject, resource, action and environment types

Line 
1"""NDG XACML context package defines classes for types in the access control
2context schema
3
4NERC DataGrid Project
5"""
6__author__ = "P J Kershaw"
7__date__ = "24/03/10"
8__copyright__ = "(C) 2010 Science and Technology Facilities Council"
9__contact__ = "Philip.Kershaw@stfc.ac.uk"
10__license__ = "BSD - see LICENSE file in top-level directory"
11__contact__ = "Philip.Kershaw@stfc.ac.uk"
12__revision__ = "$Id: $"
13from ndg.xacml.utils import TypedList
14
15class XacmlContextBase(object):
16    """Base class for XACML Request and Response types"""
17    ELEMENT_LOCAL_NAME = None
18    __slots__ = ()
19   
20    def __init__(self):
21        if self.__class__.ELEMENT_LOCAL_NAME is None:
22            raise NotImplementedError('Set "ELEMENT_LOCAL_NAME" in a derived '
23                                      'type')
24   
25   
26class RequestChildBase(XacmlContextBase):
27    """Base class for XACML Context Subject, Resource, Action and Environment
28    types"""
29    __slots__ = ('__attributes', )
30   
31    def __init__(self):
32        self.__attributes = TypedList(Attribute)
33   
Note: See TracBrowser for help on using the repository browser.