[Grok-dev] Make self.request.principal to be an instance of MyOwnPrincipalInfo (my own class)

Matthias nitro at dr-code.org
Sun Jan 9 16:24:18 EST 2011


Am 09.01.2011, 21:57 Uhr, schrieb Hector Blanco <white.lists at gmail.com>:

> Hello list!
>
> I was wondering whether is possible "extending" the "principal"
> object (zope.pluggableauth.interfaces.IPrincipalInfo) so I can add some
> fields/methods to it and then make the type of the "principal" which  
> comes in a
> request is not of the generic "zope.pluggableauth.factories.Principal"
> type but my own overloaded/extended class.

Did you take a look at dolmen.authentication and menhir.contenttype.user?  
These two packages sit on top of grok and provide authentication and  
custom principals iiuc. E.g. in mehir.contenttype.user.factories there's  
some subclassing of the Principal going on.

I know this does not answer your direct question, so maybe somebody else  
will comment further on it.

-Matthias


More information about the Grok-dev mailing list