[Zope-Checkins] SVN: Zope/branches/hannosch-dtml-vs-accesscontrol/src/ Move code from policies module
Hanno Schlichting
hannosch at hannosch.eu
Sun May 16 14:37:15 EDT 2010
Log message for revision 112376:
Move code from policies module
Changed:
U Zope/branches/hannosch-dtml-vs-accesscontrol/src/AccessControl/SimpleObjectPolicies.py
U Zope/branches/hannosch-dtml-vs-accesscontrol/src/DocumentTemplate/security.py
-=-
Modified: Zope/branches/hannosch-dtml-vs-accesscontrol/src/AccessControl/SimpleObjectPolicies.py
===================================================================
--- Zope/branches/hannosch-dtml-vs-accesscontrol/src/AccessControl/SimpleObjectPolicies.py 2010-05-16 18:35:03 UTC (rev 112375)
+++ Zope/branches/hannosch-dtml-vs-accesscontrol/src/AccessControl/SimpleObjectPolicies.py 2010-05-16 18:37:14 UTC (rev 112376)
@@ -77,21 +77,6 @@
type(u''): 1,
}
-class _dummy_class: pass
-
-from DocumentTemplate.DT_Util import TemplateDict
-# Temporarily create a DictInstance so that we can mark its type as
-# being a key in the ContainerAssertions.
-templateDict = TemplateDict()
-try:
- dictInstance = templateDict(dummy=1)[0]
- if type(dictInstance) is not type(_dummy_class()):
- ContainerAssertions[type(dictInstance)]=1
-except:
- # Hmm, this may cause _() and _.namespace() to fail.
- # What to do?
- pass
-
Containers = ContainerAssertions.get
def allow_type(Type, allowed=1):
Modified: Zope/branches/hannosch-dtml-vs-accesscontrol/src/DocumentTemplate/security.py
===================================================================
--- Zope/branches/hannosch-dtml-vs-accesscontrol/src/DocumentTemplate/security.py 2010-05-16 18:35:03 UTC (rev 112375)
+++ Zope/branches/hannosch-dtml-vs-accesscontrol/src/DocumentTemplate/security.py 2010-05-16 18:37:14 UTC (rev 112376)
@@ -16,6 +16,7 @@
import string, math, random, sets
from AccessControl import SecurityManagement
+from AccessControl.SimpleObjectPolicies import ContainerAssertions
from AccessControl.ZopeGuards import safe_builtins
import DocumentTemplate.sequence
@@ -106,3 +107,19 @@
if name.startswith('__'):
continue
setattr(DT_Util.TemplateDict, name, v)
+
+
+class _dummy_class:
+ pass
+
+# Temporarily create a DictInstance so that we can mark its type as
+# being a key in the ContainerAssertions.
+templateDict = DT_Util.TemplateDict()
+try:
+ dictInstance = templateDict(dummy=1)[0]
+ if type(dictInstance) is not type(_dummy_class()):
+ ContainerAssertions[type(dictInstance)]=1
+except:
+ # Hmm, this may cause _() and _.namespace() to fail.
+ # What to do?
+ pass
More information about the Zope-Checkins
mailing list