[Zope3-checkins]
SVN: Zope3/branches/ZopeX3-3.0/src/zope/security/checker.py
Merged from trunk 25921:
Jim Fulton
jim at zope.com
Fri Jul 2 15:40:13 EDT 2004
Log message for revision 26060:
Merged from trunk 25921:
Changed the implementation of CombinedChecker to suclass Checker
-=-
Modified: Zope3/branches/ZopeX3-3.0/src/zope/security/checker.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/security/checker.py 2004-07-02 19:36:55 UTC (rev 26059)
+++ Zope3/branches/ZopeX3-3.0/src/zope/security/checker.py 2004-07-02 19:40:13 UTC (rev 26060)
@@ -184,7 +184,7 @@
return Proxy(value, checker)
-class CombinedChecker(TrustedCheckerBase):
+class CombinedChecker(Checker):
"""A checker that combines two other checkers in a logical-or fashion.
The following table describes the result of a combined checker in detail.
@@ -204,13 +204,15 @@
def __init__(self, checker1, checker2):
"""Create a combined checker."""
- self._checker1 = checker1
+ Checker.__init__(self,
+ checker1.get_permissions,
+ checker1.set_permissions)
self._checker2 = checker2
def check(self, object, name):
'See IChecker'
try:
- self._checker1.check(object, name)
+ Checker.check(self, object, name)
except ForbiddenAttribute:
self._checker2.check(object, name)
except Unauthorized, unauthorized_exception:
@@ -221,7 +223,7 @@
def check_getattr(self, object, name):
'See IChecker'
try:
- self._checker1.check_getattr(object, name)
+ Checker.check_getattr(self, object, name)
except ForbiddenAttribute:
self._checker2.check_getattr(object, name)
except Unauthorized, unauthorized_exception:
@@ -232,7 +234,7 @@
def check_setattr(self, object, name):
'See IChecker'
try:
- self._checker1.check_setattr(object, name)
+ Checker.check_setattr(self, object, name)
except ForbiddenAttribute:
self._checker2.check_setattr(object, name)
except Unauthorized, unauthorized_exception:
@@ -240,16 +242,6 @@
except ForbiddenAttribute:
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:
"""Debugging mixin for checkers.
More information about the Zope3-Checkins
mailing list