Skip to content

Commit

Permalink
Use _is_wrapperish flag to skip PermissionMappings when getting
Browse files Browse the repository at this point in the history
context or container.
  • Loading branch information
Evan Simpson committed Jan 4, 2001
1 parent 142bc0b commit d7f505c
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions Bindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
#
##############################################################################

__version__='$Revision: 1.3 $'[11:-2]
__version__='$Revision: 1.4 $'[11:-2]

import Globals
from Globals import Persistent, HTMLFile, package_home
Expand All @@ -106,8 +106,8 @@ class NameAssignments:
# Note that instances of this class are intended to be immutable
# and persistent but not inherit from ExtensionClass.

_exprs = (('name_context', 'self.aq_parent'),
('name_container', 'self.aq_inner.aq_parent'),
_exprs = (('name_context', 'self._getContext()'),
('name_container', 'self._getContainer()'),
('name_m_self', 'self'),
('name_ns', 'self._getNamespace(caller_namespace, kw)'),
('name_subpath', 'self._getTraverseSubpath()'),
Expand Down Expand Up @@ -294,6 +294,20 @@ def _getBindCount(self):
bindcount = self._v_bindcount
return bindcount

def _getContext(self):
# Utility for bindcode.
while 1:
self = self.aq_parent
if not getattr(self, '_is_wrapperish', None):
return self

def _getContainer(self):
# Utility for bindcode.
while 1:
self = self.aq_inner.aq_parent
if not getattr(self, '_is_wrapperish', None):
return self

def _getTraverseSubpath(self):
# Utility for bindcode.
if hasattr(self, 'REQUEST'):
Expand Down

0 comments on commit d7f505c

Please sign in to comment.