First of all tx for the answer.

I added the plugin, I used the User Manager to create a user - Don with
password A,
I used the Role Manager to create 2 roles, parent and ISp, and I used
the Cookie Auth Helper to crate a log In form.
Now how do I assign a role to a user based on his password?
What I mean is the following:

I get to the log in page that the cookie plugin gave me, now I enter a
name and password and press the submit button, I now want to see if I
have a user that was defined in the ZMI with the same name and password,
and if there is how can I get what role he has and assign it to the user
that entered the data in the log in form.

-----Original Message-----
From: Lennart Regebro [mailto:rege...@gmail.com] 
Sent: Sunday, March 08, 2009 2:09 PM
To: Dvir Bar-lev
Cc: zope-pas@zope.org; z...@zope.org
Subject: Re: [Zope-PAS] user login and roles

On Sun, Mar 8, 2009 at 10:35, Dvir Bar-lev <dvi...@puresight.com> wrote:
> A user goes to the site, he see the log in screen that has 2 entry
fields - user name and password.
> The user enteres the data and presses the submit button.
> Now I want to take what the user entered and see if I have the same
user and password defined in acl_users folder, if so I want to give him
the role that that user in the acl_users folder have.

Yup, this is all automatic.

> And than based on that role direct him to the appropriate page

Aha. So your questions are two: How can I have a HTML login page, and
how can I redirect the user to different pages after login, based on
the roles.

PAS certainly helps you with this, as it has support for having HTML
forms for login. Also, as Andreas mentioned, there is a product called
CookieCrumbler that can help you with this without using PAS.

So how do you use PAS? You start using PAS by replacing your current
acl_user folder with the Pluggable Auth Service. In this you add
plugins. The plugins do different things. The User Manager will  store
users and passwords. The ZODB Role Manager will store role assigments
to users. The Cookie Auth Helper will enable you to have a login form.

Create all these, enable them, fiddle around a bit. Then you probably
need to ask more questions, and I won't know enough about PAS to
answer, but somebody else probably will.

Lennart Regebro: Pythonista, Barista, Notsotrista.
+33 661 58 14 64
Zope-PAS mailing list

Reply via email to