10 Nov
2006
10 Nov
'06
7:57 p.m.
Garito wrote at 2006-11-10 15:00 +0100:
...
You may try to return a wrapper that behaves the same way as the original object (by deriving from the respective type) but has "__roles__ = None" as additional attribute (which declares the object public).
Uau! Can you point me to a simple example or similar? I'm not sure if I understand what you are telling me
Here is a wrapper for the "str" type: class WrappedStr(str): __roles__ = None Instead of returning "some_str" you would return "WrappedStr(some_str)". The "__roles__ = None" tells the Zope security machinery that the object is public. "WrappedStr(some_str)" would almost behave like "some_str" (but of course not completely). -- Dieter