Re: [Zope3-Users] Principally annotating InternalPrincipals at creation time

2008-01-01 Thread Luciano Ramalho
Hello, John and Zope 3 gurus,

I wonder if the question reproduced below was answered somewhere. I'm
struggling with the same issue: I am using a PrincipalFolder to store
InternalPrincipal instances, but I want to annotate them but can't
figure out how.

Also, I wonder why the IInternalPrincipal does not extend IPrincipal.
I may be wrong, but I get the feeling that the name principal has
been abused to describe two different things in the API: usually a
principal is non-persistent object which represents an user during a
request, but in the case of the PrincipalFolder, the InternalPrincipal
are not those same principals, but rather persistent objects which
represent an account that allows a principal of the first kind to log
in.

Cheers and a happy 2008 to all!

--
Luciano

On Aug 11, 2007 11:56 PM, John Maddison [EMAIL PROTECTED] wrote:
 Hi all,

 I'm using a PrincipalFolder to store users who have signed up to a
 site, and during signup I'd like to ask them for some more information
 (email address, etc) and store   it in a principal annotation.
 However, PrincipalFolders use IInternalPrincipals, which do not appear
 to be easily converted to annotatable IPrincipals until after a user
 has logged in, so I'm at a bit of a loss as to how I can store this
 metadata at signup.  I guess I could log the user in and then ask for
 the information on the next page, or store the information in the
 session until the user is logged in and the IPrincipal easily
 available, but I get the feeling I'm missing something simple - this
 seems like something people would often want.  So, are people doing
 this, and if so, how?

 Thanks!
 ___
 Zope3-users mailing list
 Zope3-users@zope.org
 http://mail.zope.org/mailman/listinfo/zope3-users

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Principally annotating InternalPrincipals at creation time

2008-01-01 Thread Luciano Ramalho
On Jan 1, 2008 10:05 PM, Luciano Ramalho [EMAIL PROTECTED] wrote:
 I wonder if the question reproduced below was answered somewhere. I'm
 struggling with the same issue: I am using a PrincipalFolder to store
 InternalPrincipal instances, but I want to annotate them but can't
 figure out how.

I ended up declaring that InternalPrincipal implements the marker
interface IAttributeAnnotatable, and that allowed me to annotate to
the InternalPrincipal instances. It works because InternalPrincipal
instances reside in the ZODB, but I wonder if it's a good idea. If
it's not, then I'd love to see a recipe on how to use the
PrincipalAnnotation machinery with InternalPrincipal instances.

 Also, I wonder why the IInternalPrincipal does not extend IPrincipal.
 I may be wrong, but I get the feeling that the name principal has
 been abused to describe two different things in the API: usually a
 principal is non-persistent object which represents an user during a
 request, but in the case of the PrincipalFolder, the InternalPrincipal
 are not those same principals, but rather persistent objects which
 represent an account that allows a principal of the first kind to log
 in.

I'm still wondering about this part...

Cheers,

Luciano
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users