Zope Subversion Repository

  Zope

Zope: Zope3/trunk/src/zope/security/checker.py

Diff for /Zope3/trunk/src/zope/security/checker.py between version 25920 and 25921

version 25920, Mon Jun 21 14:04:16 2004 UTC version 25921, Mon Jun 21 14:21:03 2004 UTC
Line 184 
Line 184 
         return Proxy(value, checker)          return Proxy(value, checker)
   
   
 class CombinedChecker(TrustedCheckerBase):  class CombinedChecker(Checker):
     """A checker that combines two other checkers in a logical-or fashion.      """A checker that combines two other checkers in a logical-or fashion.
   
     The following table describes the result of a combined checker in detail.      The following table describes the result of a combined checker in detail.
Line 204 
Line 204 
   
     def __init__(self, checker1, checker2):      def __init__(self, checker1, checker2):
         """Create a combined checker."""          """Create a combined checker."""
         self._checker1 = checker1          Checker.__init__(self,
                            checker1.get_permissions,
                            checker1.set_permissions)
         self._checker2 = checker2          self._checker2 = checker2
   
     def check(self, object, name):      def check(self, object, name):
         'See IChecker'          'See IChecker'
         try:          try:
             self._checker1.check(object, name)              Checker.check(self, object, name)
         except ForbiddenAttribute:          except ForbiddenAttribute:
             self._checker2.check(object, name)              self._checker2.check(object, name)
         except Unauthorized, unauthorized_exception:          except Unauthorized, unauthorized_exception:
Line 221 
Line 223 
     def check_getattr(self, object, name):      def check_getattr(self, object, name):
         'See IChecker'          'See IChecker'
         try:          try:
             self._checker1.check_getattr(object, name)              Checker.check_getattr(self, object, name)
         except ForbiddenAttribute:          except ForbiddenAttribute:
             self._checker2.check_getattr(object, name)              self._checker2.check_getattr(object, name)
         except Unauthorized, unauthorized_exception:          except Unauthorized, unauthorized_exception:
Line 232 
Line 234 
     def check_setattr(self, object, name):      def check_setattr(self, object, name):
         'See IChecker'          'See IChecker'
         try:          try:
             self._checker1.check_setattr(object, name)              Checker.check_setattr(self, object, name)
         except ForbiddenAttribute:          except ForbiddenAttribute:
             self._checker2.check_setattr(object, name)              self._checker2.check_setattr(object, name)
         except Unauthorized, unauthorized_exception:          except Unauthorized, unauthorized_exception:
Line 240 
Line 242 
             except ForbiddenAttribute:              except ForbiddenAttribute:
                 raise unauthorized_exception                  raise unauthorized_exception
   
     def proxy(self, value):  
         'See IChecker'  
         checker = getattr(value, '__Security_checker__', None)  
         if checker is None:  
             checker = selectChecker(value)  
             if checker is None:  
                 return value  
   
         return Proxy(value, checker)  
   
 class CheckerLoggingMixin:  class CheckerLoggingMixin:
     """Debugging mixin for checkers.      """Debugging mixin for checkers.
   


Generate output suitable for use with a patch program
Legend:
Removed from v.25920  
changed lines
  Added in v.25921

webmaster@zope.org

Powered by ViewCVS 1.0-dev
(Powered by Apache)

ViewCVS and CVS Help