[Twisted-web] Get access to Avatar from Resource object?

Glyph glyph at twistedmatrix.com
Wed Feb 22 11:59:02 EST 2012


On Feb 22, 2012, at 11:02 AM, Jacek Furmankiewicz wrote:

> But there are no examples on how a Resource method (let;s say render_GET) could get access to the current Avatar object?

The avatar is a resource, and therefore it can pass itself (or any relevant authentication or authorization information) to its children as they are created.

twisted.web doesn't implement role-based authorization or anything like it.  If it did, it would use a specific object that implemented that role-based auth, not the avatar (which is an implementation of a protocol interface).

> And does the Avatar object need to implement some specific interface?

Yes, the Avatar object must provide IResource.

-glyph
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-web/attachments/20120222/d7e4fdf6/attachment.htm 


More information about the Twisted-web mailing list