sub (/src/:job) {
return NOT_FOUND if !job;
- forbid job->private || job->problem->private || job->contest && job->contest->is_running;
+ my $isowner = remote_user && remote_user->id eq job->rawowner;
+ forbid !$isowner && (job->private || job->problem->private || job->contest && job->contest->is_running);
my @headers = ('X-Forever' => 1, 'Cache-Control' => 'public, max-age=604800', 'Content-Type' => CONTENT_TYPES->{job->format});
[200, \@headers, [job->source]]
},
}, 10
},
+ sub (/ed/:contest) {
+ forbid contest->is_running;
+ response ed => 'Editorial of ' . contest->name, db->problem_list(contest => $_{contest}, solution => 1);
+ },
+
sub (/login) {
forbid !remote_user;
},
sub (/) { redispatch_to '/index' },
+ sub (/favicon.ico) { redirect '/static/favicon.ico' },
sub (/:article) { [200, ['Content-Type' => 'text/html', 'Cache-Control' => 'public, max-age=60', 'X-Forever' => 1], [render_article $_{article}, 'en']] }
},