]> ruin.nu Git - ndwebbie.git/blob - lib/NDWeb.pm
Converted editRaid page
[ndwebbie.git] / lib / NDWeb.pm
1 package NDWeb;
2
3 use strict;
4 use warnings;
5
6 use Catalyst::Runtime '5.70';
7
8 # Set flags and add plugins for the application
9 #
10 #         -Debug: activates the debug mode for very useful log messages
11 #   ConfigLoader: will load the configuration from a YAML file in the
12 #                 application's home directory
13 # Static::Simple: will serve static files from the application's root 
14 #                 directory
15
16 use parent qw/Catalyst/;
17
18 our $VERSION = '0.01';
19
20 # Configure the application. 
21 #
22 # Note that settings in ndweb.yml (or other external
23 # configuration file that you set up manually) take precedence
24 # over this when using ConfigLoader. Thus configuration
25 # details given here can function as a default configuration,
26 # with a external configuration file acting as an override for
27 # local deployment.
28
29 __PACKAGE__->config( name => 'NDWeb' );
30 __PACKAGE__->config->{'Plugin::Authentication'}{'use_session'} = 1;
31 __PACKAGE__->config(session => {
32         storage => "/tmp/ndweb-$>/sesession",
33         directory_umask => 077,
34 });
35 __PACKAGE__->config( cache => {
36         backend => {
37                 class => "Cache::FileCache",
38                 cache_root => "/tmp/ndweb-$>",
39                 directory_umask => 077,
40         },
41 });
42
43 __PACKAGE__->config( page_cache => {
44         set_http_headers => 1,
45 });
46
47
48 # Start the application
49 __PACKAGE__->setup(qw/
50         -Debug
51         ConfigLoader
52         Static::Simple
53
54         Authentication
55         Authentication::Store::NDWeb
56         Authentication::Credential::Password
57
58         Authorization::Roles
59         Authorization::ACL
60         
61         Session
62         Session::Store::File
63         Session::State::Cookie
64
65         Cache
66         PageCache
67         /);
68
69
70 __PACKAGE__->deny_access_unless('/users',[qw/admin_users/]);
71 __PACKAGE__->deny_access_unless('/alliances/resources',[qw/alliances_resources/]);
72 __PACKAGE__->deny_access_unless('/graphs/alliancevsintel',[qw/graphs_intel/]);
73 __PACKAGE__->deny_access_unless('/graphs/avgalliancevsintel',[qw/graphs_intel/]);
74 __PACKAGE__->deny_access_unless('/members',[qw/members/]);
75 __PACKAGE__->deny_access_unless('/covop',[qw/covop/]);
76 __PACKAGE__->deny_access_unless('/calls/list',[qw/calls_list/]);
77 __PACKAGE__->deny_access_unless('/calls/postcallcomment',[qw/calls_edit/]);
78 __PACKAGE__->deny_access_unless('/calls/postcallupdate',[qw/calls_edit/]);
79 __PACKAGE__->deny_access_unless('/calls/postattackerupdate',[qw/calls_edit/]);
80 __PACKAGE__->deny_access_unless('/raids',[qw/raids_edit/]);
81 __PACKAGE__->allow_access_if('/raids/index',1);
82 __PACKAGE__->allow_access_if('/raids/view',1);
83 __PACKAGE__->allow_access_if('/raids/findRaid',1);
84 __PACKAGE__->allow_access_if('/raids/log',1);
85
86 =head1 NAME
87
88 NDWeb - Catalyst based application
89
90 =head1 SYNOPSIS
91
92     script/ndweb_server.pl
93
94 =head1 DESCRIPTION
95
96 [enter your description here]
97
98 =head1 SEE ALSO
99
100 L<NDWeb::Controller::Root>, L<Catalyst>
101
102 =head1 AUTHOR
103
104 Catalyst developer
105
106 =head1 LICENSE
107
108 This library is free software, you can redistribute it and/or modify
109 it under the same terms as Perl itself.
110
111 =cut
112
113 1;