Ignore:
Timestamp:
16/03/10 11:56:31 (11 years ago)
Author:
pjkersha
Message:

Added XACML Target ElementTree based parser.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/NDGSecurity/python/ndg_security_common/ndg/security/common/authz/xacml/parsers/etree/policyreader.py

    r6733 r6734  
    1 ''' 
    2 Created on 16 Mar 2010 
     1"""NDG Security XACML ElementTree Policy Reader   
    32 
    4 @author: pjkersha 
    5 ''' 
    6 from ndg.security.common.authz.xacml.etree.reader import AbstractReader 
    7 from ndg.security.common.authz.xacml import PolicyComponent, XMLParseError 
     3NERC DataGrid Project 
     4""" 
     5__author__ = "P J Kershaw" 
     6__date__ = "16/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.security.common.authz.xacml.parsers.etree.reader import \ 
     13    EtreeAbstractReader 
     14from ndg.security.common.authz.xacml import XMLParseError 
    815from ndg.security.common.authz.xacml.policy import Policy 
    916from ndg.security.common.authz.xacml.variabledefinition import \ 
     
    1118from ndg.security.common.authz.xacml.rule import Rule 
    1219from ndg.security.common.authz.xacml.target import Target 
    13 from ndg.security.common.authz.xacml.etree import QName 
    14 from ndg.security.common.authz.xacml.etree.targetreader import TargetReader 
     20from ndg.security.common.authz.xacml.parsers.etree import QName 
     21from ndg.security.common.authz.xacml.parsers.etree.targetreader import \ 
     22    TargetReader 
    1523     
    1624     
    17 class PolicyReader(AbstractReader): 
     25class PolicyReader(EtreeAbstractReader): 
    1826    """Parse a Policy Document using ElementTree 
    1927    """ 
     
    6270                    
    6371            elif localName == Target.ELEMENT_LOCAL_NAME: 
    64                 target = TargetReader.parse(childElem) 
     72                policy.target = TargetReader.parse(childElem) 
    6573              
    6674            elif localName == cls.COMBINER_PARAMETERS_LOCAL_NAME: 
     
    7482                 
    7583            elif localName == Rule.ELEMENT_LOCAL_NAME: 
    76                 rule = RuleReader.parse(childElem) 
     84                policy.rules.append(RuleReader.parse(childElem)) 
    7785                    
    7886            elif localName == cls.OBLIGATIONS_LOCAL_NAME: 
Note: See TracChangeset for help on using the changeset viewer.