Changeset 2803


Ignore:
Timestamp:
14/08/07 13:20:55 (12 years ago)
Author:
lawrence
Message:

Bug fix for ticket:846

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/models/ndgSecurity.py

    r2798 r2803  
    8282            raise OwsError, 'NDG Security Error: No %s'%m 
    8383         
     84         
     85 
     86    def __call__(self, **kw): 
     87        """Convenience wrapper for checkAccess""" 
     88        return self.checkAccess(**kw) 
     89 
     90 
     91    def checkAccess(self, securityElement=None, securityTokens=None): 
     92        """Make an access control decision based on whether the user is 
     93        authenticated and has the required roles 
     94         
     95        @type: ElementTree Element 
     96        @keyword securityElement: MOES security constraint containing role and 
     97        Attribute Authority URI. In xml, could look like: 
     98        <moles:effect>allow</moles:effect> 
     99            <moles:simpleCondition> 
     100            <moles:dgAttributeAuthority>https://glue.badc.rl.ac.uk/AttributeAuthority</moles:dgAttributeAuthority> 
     101            <moles:attrauthRole>coapec</moles:attrauthRole> 
     102        </moles:simpleCondition> 
     103        NB: xmlns:moles="http://ndg.nerc.ac.uk/moles" 
     104         
     105        @type: pylons.session 
     106        @keyword securityTokens: dict-like session object containing security  
     107        tokens.  Resets equivalent object attribute.""" 
     108      
    84109        # Check self.securityTokens - if not set then the user mustn't be  
    85110        # logged in.  This situation is possible if a user has been denied 
     
    105130                            caCertFilePathList=self.wssCACertFilePathList, 
    106131                            tracefile=self.tracefile)        
    107  
    108  
    109     def __call__(self, **kw): 
    110         """Convenience wrapper for checkAccess""" 
    111         return self.checkAccess(**kw) 
    112  
    113  
    114     def checkAccess(self, securityElement=None, securityTokens=None): 
    115         """Make an access control decision based on whether the user is 
    116         authenticated and has the required roles 
    117          
    118         @type: ElementTree Element 
    119         @keyword securityElement: MOES security constraint containing role and 
    120         Attribute Authority URI. In xml, could look like: 
    121         <moles:effect>allow</moles:effect> 
    122             <moles:simpleCondition> 
    123             <moles:dgAttributeAuthority>https://glue.badc.rl.ac.uk/AttributeAuthority</moles:dgAttributeAuthority> 
    124             <moles:attrauthRole>coapec</moles:attrauthRole> 
    125         </moles:simpleCondition> 
    126         NB: xmlns:moles="http://ndg.nerc.ac.uk/moles" 
    127          
    128         @type: pylons.session 
    129         @keyword securityTokens: dict-like session object containing security  
    130         tokens.  Resets equivalent object attribute.""" 
    131       
     132                             
    132133        if securityElement: 
    133134            self.securityElement=securityElement 
Note: See TracChangeset for help on using the changeset viewer.