diff --git a/implementation/SIMS/SIMS/lib/SIMS/Controller/Report.pm b/implementation/SIMS/SIMS/lib/SIMS/Controller/Report.pm index 0ac8986..9515e99 100644 --- a/implementation/SIMS/SIMS/lib/SIMS/Controller/Report.pm +++ b/implementation/SIMS/SIMS/lib/SIMS/Controller/Report.pm @@ -1,7 +1,7 @@ package SIMS::Controller::Report; use Moose; use namespace::autoclean; - +use Data::Dumper; BEGIN {extends 'Catalyst::Controller'; } =head1 NAME @@ -20,13 +20,28 @@ Catalyst Controller. =head2 index =cut +sub base : Chained('/') PathPart('report') CaptureArgs(0) { + my ( $self, $c ) = @_; + + $c->session->{original_URI} = $c->request->uri; + my @roles = $c->user->roles(); + + $c->response->redirect( $c->uri_for('/unauthorized') ) + unless ( grep /(g_admin)/, @roles ); +} -sub index :Path :Args(0) { +sub index : Chained('base') : PathPart('') : Args(0) { my ( $self, $c ) = @_; - $c->response->body('Matched SIMS::Controller::Report in Report.'); } +sub add_query : Chained('base') : PathPart('add_query') : Args(0) { + my ( $self, $c ) = @_; + + $c->response->body( Dumper $c->request->params() ); + + +} =head1 AUTHOR diff --git a/implementation/SIMS/SIMS/lib/SIMS/Controller/Root.pm b/implementation/SIMS/SIMS/lib/SIMS/Controller/Root.pm index 08ecb6c..a9340a9 100644 --- a/implementation/SIMS/SIMS/lib/SIMS/Controller/Root.pm +++ b/implementation/SIMS/SIMS/lib/SIMS/Controller/Root.pm @@ -46,7 +46,8 @@ sub index : Path : Args(0) { push( @{$dashboard}, { src => $c->uri_for('techadmin'), text => 'Manage Users' }, - { src => $c->uri_for('graduateadmin/supervisors'), text => 'Manage Supervisors' } + { src => $c->uri_for('graduateadmin/supervisors'), text => 'Manage Supervisors' }, + { src => $c->uri_for('report'), text => 'Manage Report' } ); }