[jifty-devel] RFC: Login/Logout functionality

John Peacock jpeacock at rowman.com
Wed Jun 14 22:36:06 EDT 2006


John Peacock wrote:
> I've finally had some time to look at creating Jifty::Plugin::Login (based
> completely on the login bits in Wifty) and I'm at a bit of a brick wall.  It
> seems like the call to Jifty->api->allow (in J::Plugins::new_request) isn't
> affecting the application's list of allowed actions.  I've confirmed that
> J::P::Login::new_request is being called (by creating a wrapper), but even if I
> replace it with the exact same code that is in the base class, nothing is being
> added.

To respond to myself, the problem was that, in the Jifty::Plugin::Login
dispatcher, the class attached to any actions must be fully qualified.  In other
words, this works:

# Login
on 'login' => run {
    set 'action' =>
        Jifty->web->new_action(
            class => 'Jifty::Plugin::Login::Action::Login', # fully qualified
            moniker => 'loginbox'
        );
    set 'next' => Jifty->web->request->continuation
        || Jifty::Continuation->new(
        request => Jifty::Request->new( path => "/" ) );
};

It would be nice if there was a way make a loop over both the app class and any
plugin classes before throwing an error, possibly at /lib/Jifty/Web.pm:405.

Now that I have this working, I can work out how to best handle the app user
objects (just subclass the plugin's user objects?).

John

-- 
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4720 Boston Way
Lanham, MD 20706
301-459-3366 x.5010
fax 301-429-5747


More information about the jifty-devel mailing list