From: Marius Gavrilescu Date: Sun, 4 Jan 2015 15:28:11 +0000 (+0200) Subject: Add a "private" parameter to /log/ and /pb/ X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=b8a0fa7145b52cf9a2263602352802d5323bde90;p=plack-app-gruntmaster.git Add a "private" parameter to /log/ and /pb/ --- diff --git a/lib/Plack/App/Gruntmaster.pm b/lib/Plack/App/Gruntmaster.pm index da00862..b011ffa 100644 --- a/lib/Plack/App/Gruntmaster.pm +++ b/lib/Plack/App/Gruntmaster.pm @@ -152,8 +152,14 @@ sub dispatch_request{ sub (/us/) { response us => 'Users', {us => db->user_list} }, sub (/ct/ + ?:owner~) { response ct => 'Contests', db->contest_list(%_) }, - sub (/log/ + ?:contest~&:owner~&:page~&:problem~) { response log => 'Job list', {%{db->job_list(%_)}, maybe contest => $_{contest}} }, - sub (/pb/ + ?:owner~&:contest~) { response pb => 'Problems', {%{db->problem_list(%_)}, maybe contest => $_{contest}} }, + sub (/log/ + ?:contest~&:owner~&:page~&:problem~&:private~) { + forbid $_{private}; + response log => 'Job list', {%{db->job_list(%_)}, maybe contest => $_{contest}} + }, + sub (/pb/ + ?:owner~&:contest~&private~) { + forbid $_{private}; + response pb => 'Problems', {%{db->problem_list(%_)}, maybe contest => $_{contest}} + }, sub (/us/:user) { response us_entry => user->name, db->user_entry($_{user}) }, sub (/ct/:contest) { response ct_entry => contest->name, db->contest_entry($_{contest}) },