]> ruin.nu Git - ndwebbie.git/blob - lib/NDWeb.pm
bugfix, need access to findCall to view own calls
[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-$>/session",
33         directory_umask => 077,
34         expires => 300,
35         verify_address => 1,
36 });
37 __PACKAGE__->config( cache => {
38         backend => {
39                 class => "Cache::FileCache",
40                 cache_root => "/tmp/ndweb-$>",
41                 namespace => "cache",
42                 default_expires_in => 3600,
43                 directory_umask => 077,
44         },
45 });
46
47 __PACKAGE__->config( page_cache => {
48         set_http_headers => 1,
49         disable_index => 1,
50 });
51
52
53 # Start the application
54 __PACKAGE__->setup(qw/
55         -Debug
56         ConfigLoader
57         Static::Simple
58         Unicode
59
60         Authentication
61         Authentication::Store::NDWeb
62         Authentication::Credential::Password
63
64         Authorization::Roles
65         Authorization::ACL
66         
67         Session::DynamicExpiry
68         Session
69         Session::Store::File
70         Session::State::Cookie
71
72         Compress::Gzip
73         Compress::Deflate
74
75         Cache
76         PageCache
77         /);
78
79
80 __PACKAGE__->deny_access_unless('/users',[qw/admin_users/]);
81 __PACKAGE__->deny_access_unless('/alliances',[qw/alliances/]);
82 __PACKAGE__->deny_access_unless('/alliances/resources',[qw/alliances_resources/]);
83 __PACKAGE__->deny_access_unless('/graphs/alliancevsintel',[qw/graphs_intel/]);
84 __PACKAGE__->deny_access_unless('/graphs/avgalliancevsintel',[qw/graphs_intel/]);
85 __PACKAGE__->deny_access_unless('/members',[qw/members/]);
86 __PACKAGE__->deny_access_unless('/covop',[qw/covop/]);
87 __PACKAGE__->deny_access_unless('/calls',[qw/calls_edit/]);
88 __PACKAGE__->allow_access_if('/calls/index',[qw/calls_list/]);
89 __PACKAGE__->allow_access_if('/calls/list',[qw/calls_list/]);
90 __PACKAGE__->allow_access_if('/calls/edit',[qw/members/]);
91 __PACKAGE__->allow_access_if('/calls/findCall',[qw/members/]);
92 __PACKAGE__->deny_access_unless('/raids',[qw/raids_edit/]);
93 __PACKAGE__->allow_access_if('/raids/index',[qw//]);
94 __PACKAGE__->allow_access_if('/raids/view',[qw//]);
95 __PACKAGE__->allow_access_if('/raids/findRaid',[qw//]);
96 __PACKAGE__->allow_access_if('/raids/log',[qw//]);
97 __PACKAGE__->deny_access_unless('/intel',[qw/intel/]);
98 __PACKAGE__->deny_access_unless('/intel/members',[qw/intel_members/]);
99 __PACKAGE__->deny_access_unless('/intel/member',[qw/intel_member/]);
100 __PACKAGE__->deny_access_unless('/intel/naps',[qw/intel_naps/]);
101 __PACKAGE__->deny_access_unless('/jsrpc',[qw//]);
102 __PACKAGE__->allow_access_if('/jsrpc/end',1);
103 __PACKAGE__->deny_access_unless('/forum/allUnread',[qw//]);
104 __PACKAGE__->deny_access_unless('/forum/privmsg',[qw//]);
105 __PACKAGE__->deny_access_unless('/settings',[qw//]);
106 __PACKAGE__->deny_access_unless('/textexport/alliance',[qw/textexport_alliance/]);
107
108 =head1 NAME
109
110 NDWeb - Catalyst based application
111
112 =head1 SYNOPSIS
113
114     script/ndweb_server.pl
115
116 =head1 DESCRIPTION
117
118 [enter your description here]
119
120 =head1 SEE ALSO
121
122 L<NDWeb::Controller::Root>, L<Catalyst>
123
124 =head1 AUTHOR
125
126 Catalyst developer
127
128 =head1 LICENSE
129
130 This library is free software, you can redistribute it and/or modify
131 it under the same terms as Perl itself.
132
133 =cut
134
135 1;