Hi,

I created a Role and a Permission affected to it :
<role id="app.User" title="Utilisateur" />
<permission id="app.Auth" title="Utilisateur authentifié" />
<grant permission="app.Auth" role="app.User" />

My users are store in a PostgreSQL database, not in the ZODB.
I use the Zope authentication system to return a PrincipalInfo when an
user log in.

I do not know how to assign my "app.User" Role to the Principal who log in.
I tried the following, without success :

@adapter(IAuthenticatedPrincipalCreated)
def setPermission(event):
    role_map = IPrincipalRoleManager(getSiteManager())
    role_map.assignRoleToPrincipal('app.User', event.principal.id)

Thanks for any kind of help !
_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to