Re: [Zope-PAS] proposal: IUserAdder plugins

2007-05-05 Thread Jens Vagelpohl

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On 5 May 2007, at 17:00, Wichert Akkerman wrote:

I think that a better approach would be to use events. I made a branch
a while ago which has an event which is fired when a new user is  
created
which solves your use case perfectly. That branch is still missing  
test
for the events though. Someday I need to write those and offer it  
up for

merging.


Using events does indeed sound like the best solution, not just for  
this particular use case. I've been in quite a few situation where  
contortions were needed because one plugin needed to communicate with  
another one, which is pretty evil. Events are a good solution to any  
problem like that.


jens



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (Darwin)

iD8DBQFGPQkVRAx5nvEhZLIRAu58AJ9Vkd6QKmq8+FYrRpg0UoM555R76wCcD8tX
d9kFyZmTaeexH+24uoW1mzU=
=k9SE
-END PGP SIGNATURE-
___
Zope-PAS mailing list
Zope-PAS@zope.org
http://mail.zope.org/mailman/listinfo/zope-pas


Re: [Zope-PAS] proposal: IUserAdder plugins

2007-05-05 Thread Wichert Akkerman
Previously Miles wrote:
> However, when a user is created, PAS runs through all the plugins 
> implementing the IUserAdder interface, but once a plugin indicates that 
> it created a user, it proceeds no further.
> 
> I was expecting it to pass the details onto all the plugins, to give 
> each a chance to create any additional information the plugin needs, and 
> to avoid having to produce a succession of plugins.  In the same way 
> that the properties plugins each get to provide a separate property 
> sheet, rather than just returning the first one.

I think that a better approach would be to use events. I made a branch
a while ago which has an event which is fired when a new user is created
which solves your use case perfectly. That branch is still missing test
for the events though. Someday I need to write those and offer it up for
merging.

> I would like to change this so all IUserAdder plugins get a chance to 
> fire - does anyone have an opinion on it?

-1, we can not change semantics of existing interfaces.

Wichert.

-- 
Wichert Akkerman <[EMAIL PROTECTED]>It is simple to make things.
http://www.wiggy.net/   It is hard to make things simple.
___
Zope-PAS mailing list
Zope-PAS@zope.org
http://mail.zope.org/mailman/listinfo/zope-pas


Re: [Zope-PAS] proposal: IUserAdder plugins

2007-05-05 Thread Kapil Thangavelu

On Fri, 04 May 2007 14:54:59 -0400, Miles <[EMAIL PROTECTED]> wrote:

I seem to be generating a sizable proportion of the traffic on this  
list!  Apologies in advance for another email...


My use case is as follows:

I have a zope website, a php forum and blog that make up my site, each  
with their own user databases.  Whenever users register through the zope  
site (I have removed links so they cannot register elsewhere), I want to  
create corresponding user accounts for them in the database for the  
forum and the blog.


However, when a user is created, PAS runs through all the plugins  
implementing the IUserAdder interface, but once a plugin indicates that  
it created a user, it proceeds no further.


right, which makes sense to me, you don't really want it to create  
multiple users, shadowing each other for login purposes. only one gets to  
login. it sounds like you just want to have your custom useradder plugin  
ordered higher than the default zodb user plugin.




I was expecting it to pass the details onto all the plugins, to give  
each a chance to create any additional information the plugin needs, and  
to avoid having to produce a succession of plugins.  In the same way  
that the properties plugins each get to provide a separate property  
sheet, rather than just returning the first one.


property providers are separate then adder, and each property provider is  
called for a principle.




I would like to change this so all IUserAdder plugins get a chance to  
fire - does anyone have an opinion on it?




-1, semantically makes no sense.

-kapil
___
Zope-PAS mailing list
Zope-PAS@zope.org
http://mail.zope.org/mailman/listinfo/zope-pas