--- a/ztfy/utils/security.py Sat Oct 10 00:19:49 2009 +0200
+++ b/ztfy/utils/security.py Wed Dec 02 23:10:48 2009 +0100
@@ -14,12 +14,15 @@
# import standard packages
+from persistent.list import PersistentList
+from persistent.dict import PersistentDict
# import Zope3 interfaces
# import local interfaces
# import Zope3 packages
+from zc.set import Set
from zope.security.proxy import removeSecurityProxy
# import local packages
@@ -27,14 +30,18 @@
def unproxied(value):
"""Remove security proxies from given value ; if value is a list or dict, all elements are unproxied"""
- if isinstance(value, list):
+ if isinstance(value, (list, PersistentList)):
result = []
for v in value:
result.append(unproxied(v))
- elif isinstance(value, dict):
+ elif isinstance(value, (dict, PersistentDict)):
result = value.copy()
for v in value:
result[v] = unproxied(value[v])
+ elif isinstance(value, (set, Set)):
+ result = []
+ for v in value:
+ result.append(unproxied(v))
else:
result = removeSecurityProxy(value)
return result