FAQ
Hi folks:

I now have the bits up and seemingly talking to the database. Took a
few hours off to think about why the myapp_create.pl would error out
when creating the Model. Seems that a good log off/log on fixed
everything (not sure why, possibly a running server instance).

I am building a main page which serves as the login page for the
system. I am assuming that it makes more sense to have this go through
a login/authentication controller than to do this in the main module.
Is this correct? I think I have seen this both ways now (suggestions of
using a controller, and the documentation on
http://search.cpan.org/~sri/Catalyst-5.61/lib/Catalyst/Manual/Cookbook.pod#Require_user_logins
which suggests doing this in the main module).

Basically I want to have all access to the system go through the
login system (with timed sessions), and implement roles from there (end
user, admin).

Any thoughts on whether the separate controller is needed/desired?

Thanks!

Joe

--
Joseph Landman, Ph.D
Founder and CEO
Scalable Informatics LLC,
email: landman@scalableinformatics.com
web : http://www.scalableinformatics.com
phone: +1 734 786 8423
fax : +1 734 786 8452
cell : +1 734 612 4615

Search Discussions

  • Andreas Marienborg at Dec 23, 2005 at 7:56 am

    On 23. des. 2005, at 04.41, Joe Landman wrote:
    I am building a main page which serves as the login page for the
    system. I am assuming that it makes more sense to have this go
    through a login/authentication controller than to do this in the
    main module. Is this correct? I think I have seen this both ways
    now (suggestions of using a controller, and the documentation on
    http://search.cpan.org/~sri/Catalyst-5.61/lib/Catalyst/Manual/
    Cookbook.pod#Require_user_logins which suggests doing this in the
    main module).

    Basically I want to have all access to the system go through the
    login system (with timed sessions), and implement roles from there
    (end user, admin).

    What I would do (and did for Agave for instance), is create a Auth-
    controller, that basicly has a Path action (/logout), and some
    private actions (login, no_access and other errors). [1]

    What this enables me to do, is when I get a request for a protected
    section (for intance, everything under the Admin-controller), I can
    in Admin.pm do: [2]

    unless ($c->user_exists) {
    $c->forward('/auth/login');
    return 0 unless $c->user_exists;
    }
    unless ($c->user->user->is_admin) {
    $c->forward('/auth/no_admin');
    return 0;
    }


    Perhaps a similar scheme can be deployed in your app. What I find, is
    that the main app class generaly only should have as little as
    possible. I use it to override some parts of catalyst, and a few
    standard actions (auto, default, index etc). [3]

    hope some of that clears some questions up

    andreas

    [1] : http://dev.rawmode.org/file/trunk/lib/Agave/C/Auth.pm
    [2] : http://dev.rawmode.org/file/trunk/lib/Agave/C/Admin.pm
    [3] : http://dev.rawmode.org/file/trunk/lib/Agave.pm

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedDec 23, '05 at 4:35a
activeDec 23, '05 at 7:56a
posts2
users2
websitecatalystframework.org
irc#catalyst

2 users in discussion

Andreas Marienborg: 1 post Joe Landman: 1 post

People

Translate

site design / logo © 2021 Grokbase