Re: Get access to Avatar from Resource object?

Glyph <[email protected]>
Newsgroups gmane.comp.python.twisted.web
Message-ID <[email protected]>
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

_______________________________________________
Twisted-web mailing list
[email protected]
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.