On 9/20/05, Trickett, Adam <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I've been playing with Maypole for a project at work. Basically we've taken 
> the BeerDB example, and made a simple and functioning CRUD web front end. 
> Everything works well, and the users are very happy with it.
>
> The snag is that we need to restrict who can change the database, most people 
> only need to be able to see data.
>
> I've added:
>
> use Maypole::Application qw(Authentication::UserSessionCookie Authorization);
>
> and created the tables as described in the POD.
>
> When I login as the user, it sets a cookie and lets me in okay. When I go to 
> another page, it fails with the following error:
>
> caught authenticate error: Couldn't load user class Ibudb::User at 
> /usr/local/lib/perl5/site_perl/5.6.1/Maypole/Plugin/Authentication/UserSessionCookie.pm
>  line 170, <GEN2> line 3.
>

Do you understand this err msg?  M::P::A::U is trying to require the
class representing your user.   Ibudb::User is what it thinks it is.
It is either not in your path or you have a typo in the name, I' m
guessing.


> The authentication code is:
>
> sub authenticate {
>     my ($self, $r) = @_;
>     $r->get_user;
>     return OK if $r->{user};
>     return OK if $r->action eq "register" and $r->table eq "user";
>     $r->template("login");
>     return OK;
> }

Note also that the above code allows any user to do everything.  You
do not call authorize.  See M::P::A docs for how to set up roles and 
permissions.  It is really easy to do what you want with M::P::A.

hth
--
pjs


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Maypole-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maypole-users

Reply via email to