From b8a0fa7145b52cf9a2263602352802d5323bde90 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Sun, 4 Jan 2015 17:28:11 +0200 Subject: [PATCH] Add a "private" parameter to /log/ and /pb/ --- lib/Plack/App/Gruntmaster.pm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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}) }, -- 2.39.2