Changeset 1170


Ignore:
Timestamp:
13/06/06 16:39:24 (13 years ago)
Author:
domlowe
Message:

Added !getSecurity method to CSML API

Location:
TI02-CSML/trunk/parser/API
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TI02-CSML/trunk/parser/API/__init__.py

    r1086 r1170  
    4545#Dataset methods: 
    4646Parser.Dataset.parse=ops_Dataset.parse 
     47Parser.Dataset.getSecurity=ops_Dataset.getSecurity 
    4748Parser.Dataset.getFeatureList=ops_Dataset.getFeatureList 
    4849Parser.Dataset.getFeature=ops_Dataset.getFeature 
  • TI02-CSML/trunk/parser/API/ops_Dataset.py

    r1111 r1170  
    1212        self.fromXML(tree.getroot()) 
    1313        self =parser_extra.ParserPostProcessor(self).resolveReferences() 
     14 
     15def getSecurity(self): 
     16    """ returns a dictonary containing attributeAuthority: role""" 
     17    security=[] 
     18    if hasattr(self, 'accessControlPolicy'): 
     19        if hasattr(self.accessControlPolicy,'dgSecurityConditions'): 
     20            for condition in self.accessControlPolicy.dgSecurityConditions: 
     21                print dir(condition) 
     22                #need to test for these but ok for alpha. 
     23                cond=[] 
     24                cond.append(condition.effect) 
     25                cond.append(condition.simpleCondition.dgAttributeAuthority) 
     26                cond.append(condition.simpleCondition.attrauthRole) 
     27                cond.append(condition.conditionExplanationText) 
     28                security.append(cond) 
     29    return security 
    1430 
    1531def getFeatureList(self): 
Note: See TracChangeset for help on using the changeset viewer.