Skip to content

Commit

Permalink
validate roles for vote and user examination
Browse files Browse the repository at this point in the history
  • Loading branch information
mjmusante committed Aug 31, 2024
1 parent dd84ecc commit 70a8d46
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions IFComp/lib/IFComp/Controller/Admin/Voting.pm
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@ sub index : Chained('/admin/root') : PathPart( 'voting') : Args(0) {
sub show_entry : Chained('index') : Path : Args(1) {
my ( $self, $c, $entry_id ) = @_;

# Must have a votecounter
unless ( $c->user && $c->check_any_user_role('votecounter') ) {
$c->res->redirect('/');
return;
}

my $entry = $c->model('IFCompDB::Entry');
my $this_entry = $entry->find($entry_id);
my @score_buckets;
Expand Down
6 changes: 6 additions & 0 deletions IFComp/lib/IFComp/Controller/Admin/Voting/User.pm
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ A controller for voting reports.
sub show_user : Chained("/admin/voting/index") : Path : Args(2) {
my ( $self, $c, $user_id, $comp_id ) = @_;

# Must have a votecounter
unless ( $c->user && $c->check_any_user_role('votecounter') ) {
$c->res->redirect('/');
return;
}

my $comp = $c->model('IFCompDB::Comp')->find($comp_id);
my $user = $c->model('IFCompDB::User')->find($user_id);
my @comp_entries =
Expand Down

0 comments on commit 70a8d46

Please sign in to comment.