Ignore:
Timestamp:
25.06.2010 23:24:03 (2 years ago)
Author:
zmsdev
Message:

Revised unauthorized.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ZMS/trunk/ZMSGlobals.py

    r1051 r1067  
    3030from cStringIO import StringIO 
    3131from types import StringTypes 
    32 from zExceptions import Unauthorized 
    3332from binascii import b2a_base64, a2b_base64 
    3433import base64 
     
    13571356      if _globals.debug( self): 
    13581357        _globals.writeLog( self, '[localfs_read]: filename=%s'%filename) 
     1358       
    13591359      # Check permissions. 
    1360       access = False 
    1361       for perm in self.getConfProperty('ZMS.localfs_read','').split(';')+[package_home(globals())]: 
    1362         access = access or ( len( perm) > 0 and filename.lower().startswith( perm.lower())) 
    1363       # Raise unauthorized error. 
    1364       if not access: 
    1365         raise Unauthorized 
     1360      if REQUEST is not None: 
     1361        authorized = False 
     1362        for perm in self.getConfProperty('ZMS.localfs_read','').split(';')+[package_home(globals())]: 
     1363          authorized = authorized or ( len( perm) > 0 and filename.lower().startswith( perm.lower())) 
     1364        if not authorized: 
     1365          RESPONSE = REQUEST.RESPONSE 
     1366          raise REPONSE.unauthorized() 
     1367       
    13661368      # Read file. 
    13671369      if type( mode) is dict: 
Note: See TracChangeset for help on using the changeset viewer.