package ThinkIT::Authorizer; use strict; use base qw(Sledge::Authorizer::Null); sub authorize { my($self, $page) = @_; unless(my $user_info = $page->session->param('login')) { return $page->redirect('/login'); } }
package ThinIT::Pages::Authz: use strict; use base qw(ThinIT::Pages); use ThinIT::Authorizer; __PACKAGE__->tmpl_dirname('authz'); sub create_authorizer { return ThinIT::Authorizer->new($self); }