[Zope3-Users] How to access object generated by outer library in a view

Albertas Agejevas alga at pov.lt
Fri Dec 28 07:53:05 EST 2007


On Thu, Dec 27, 2007 at 12:13:40PM +0900, Yosuke Kawasaki wrote:
> I am a newbie in zope3.
> I am trying to make a view which shows the result of BLAST
> sequence aligner using Biopython.
> When I access the raw data object (generator object) which
> Bio.NCBIXML returned,
> zope raises ForbiddenAttribute Error.
> 
> I think I can workaround this by transferring all data
> into some list or dictionary before passing it
> to view object. But It would be nice if I can access the
> structure in view because the object is rather big and
> complex.
> 
> I have no idea to declare permission to this kind of
> object (generated by outer library).
> Please tell me what is the best way to deal with this
> situation.

There are two options.  Either (in your ZCML) you define the
permissions for the relevant classes in the library you're using, or
you can use zope.security.proxy.removeSecurityProxy on your generator
to unwrap it.

Albertas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zope3-users/attachments/20071228/424e9520/attachment.bin


More information about the Zope3-users mailing list