[Zope3-Users] Best way to add a Principal to PAU

Florian Lindner mailinglists at xgm.de
Mon Feb 6 15:02:16 EST 2006


Am Sonntag, 5. Februar 2006 22:37 schrieb Stephan Richter:
> On Sunday 05 February 2006 12:34, Florian Lindner wrote:
> > I've managed to add a principal to a principal folder inside a PAU:
> >
> >   pau = getUtility(IAuthentication)
> >   pfolder = pau.keys()[0]
> >   principal = InternalPrincipal("def", "pwd123","a title", "a
> > description") pfolder["def"] = principal
> >
> > but I doubt that the most elegant way. How can I achieve do it more or
> > less agnostic form the principal source (or a least from the name and
> > ordinal postion inside PAU)?
>
> Basically, your application should know the location of the Authentication
> Utility and the name of the principal folder. Also note that the principal
> class is principal folder specific.

Ok, so the way above is the way to go?

Why is the principal class folder specific?

BTW: Why does z.a.authentication.principalfolder.InternalPrincipal does not 
implement z.security.interfaces.IPrincipal? Or let 
z.a.authentication.principalfolder.IInternalPrincipal derive from IPrincipal?

Florian


More information about the Zope3-users mailing list