X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FPlack%2FApp%2FGruntmaster.pm;h=45cdfd1c5107e7babaad66a51a1f0a4885a5d406;hb=7d3edc4b152539c4b5b14e10bf406e281e94a81c;hp=bd11fe04e33c429dd3ef7ed8cc7342ddd5cead95;hpb=f34b3eac41f334d38380a5214180d30415637284;p=plack-app-gruntmaster.git diff --git a/lib/Plack/App/Gruntmaster.pm b/lib/Plack/App/Gruntmaster.pm index bd11fe0..45cdfd1 100644 --- a/lib/Plack/App/Gruntmaster.pm +++ b/lib/Plack/App/Gruntmaster.pm @@ -113,7 +113,8 @@ sub dispatch_request{ 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]] },