]> ruin.nu Git - ndwebbie.git/blobdiff - lib/NDWeb.pm
Converted users to catalyst
[ndwebbie.git] / lib / NDWeb.pm
index 2dbab22e755946756581e26838f19abec9883b4f..8cc8388798f1d2dec3b48f1d2fd483be1b41c890 100644 (file)
@@ -5,6 +5,10 @@ use warnings;
 
 use Catalyst::Runtime '5.70';
 
+#Need to preload, otherwise the first hit is slow
+use CGI qw/:standard/;
+escapeHTML('');
+
 # Set flags and add plugins for the application
 #
 #         -Debug: activates the debug mode for very useful log messages
@@ -27,11 +31,30 @@ our $VERSION = '0.01';
 # local deployment.
 
 __PACKAGE__->config( name => 'NDWeb' );
+__PACKAGE__->config->{'Plugin::Authentication'}{'use_session'} = 1;
 
-# Start the application
-__PACKAGE__->setup(qw/-Debug ConfigLoader Static::Simple/);
 
 
+# Start the application
+__PACKAGE__->setup(qw/
+       -Debug
+       ConfigLoader
+       Static::Simple
+
+       Authentication
+       Authentication::Store::NDWeb
+       Authentication::Credential::Password
+
+       Authorization::Roles
+       Authorization::ACL
+       
+       Session
+       Session::Store::File
+       Session::State::Cookie
+       /);
+
+__PACKAGE__->deny_access_unless('/users',[qw/admin_users/]);
+
 =head1 NAME
 
 NDWeb - Catalyst based application