Peter Speltz wrote:
> 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/Authentica
> tion/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.
It's in the path, as mod_perl starts with path to Ibudb.pm, and nothing would
work without that. Ibudb::User is a defined package within the Ibudb.pm file.
>> 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.
I though it should be easy, on paper it doesn't look that hard. The problem
seems to be conflicting docs (gradually getting better), and me not being able
to allocate enough time in a solid block to get it all done.
I'll have to have another look at the examples in M::P::A.
I'm sure it's a silly typo, I just wanted to make sure I'm not barking up the
wrong tree.
--
A
-------------------------------------------------------
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