Ignore:
Timestamp:
16/05/06 13:09:07 (14 years ago)
Author:
lawrence
Message:

Pretty sure this will have broken the browse,
but can't check at the moment. This is the first
commit that has live links to the security code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI07-MOLES/trunk/StubB/XSLT/browse/portal/cgi/secure.py

    r886 r935  
     1from Utilities import wrapGetText 
    12 
    2  
     3class AccessControl: 
     4         
     5        ''' Handle the access control metadata and provide three attributes of the  
     6        access control: exists (existence), status (modified elsewhere for whether 
     7        user can access data), and html (a message about the constraints). ''' 
     8         
     9        def __init__(self,e): 
     10                if e is None: 
     11                        self.status=1 
     12                        self.exist=0 
     13                        self.html='' 
     14                else: 
     15                        #for now assume everything with a simplecondition is deny 
     16                        self.html=wrapGetText(e,'dgSecurityCondition/conditionExplanationText') 
     17                        sc='dgSecurityCondition/simpleCondition/' 
     18                        self.SimpleCondition=(wrapGetText(e,sc+'attrauthRole'), 
     19                                              wrapGetText(e,sc+'dgAttributeAuthority')) 
     20                        if self.SimpleCondition==('',''): self.SimpleCondition=None 
     21                        self.status=0 
     22                        self.exist=1 
     23         
     24         
    325class AttributeAuthorityClient: 
    426        ''' placeholder til Phil writes his''' 
     
    84106                        pass # for now we don't have the libraries or code attached 
    85107 
    86         def check(self, role, wsdlAA): 
     108        def check(self, parsedSimpleCondition): 
    87109                ''' can the credentials in the wallet support access to the resource requiring  
    88                 the role at wsdlAA ''' 
     110                the role at wsdlAA - parsedSimpleCondition is a tuple - (role, wsdlAA) ''' 
    89111                #connect using cookie 
     112 
     113                #first make sure we've got real conditions, if not, deny ... 
     114                if parsedSimpleCondition is None: return 0 
    90115 
    91116                resp = smClient.reqAuthorisation(sessCookie=cookieObj, 
Note: See TracChangeset for help on using the changeset viewer.