Christian Klinger schrieb:
Hi,
i try to fetch users from an rdbms to authenticate them in zope3.
I have created a custom AuthenticatorPlugin which reads the
user from an sqltable and return the PrincipalInfo when
username password is valid. This works so far.
Now the Problem:
I have role information in my rdbms table and i want that
my principals get these roles.
But i donĀ“t know how can i assign these roles
to my principal.
Maybe something like that:
return PrincipalInfo(self.prefix+login, login, login, login,
['Manager','Viewer',])
In Zope2 PAS there is a IRolesPlugin which assign the role to
the principal.
Maybe someone had an idea or an example for me.
Christian
Hi,
i have found it myself. I have to access the event
<subscriber
for="zope.app.authentication.interfaces.IAuthenticatedPrincipalCreated"
handler=".plugins.event.authenticated_principal_created"
/>
and add my role to:
def authenticated_principal_created(event):
principal = event.principal
principal.groups.append('zope.Manager')
Thx Christian
_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users