X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FPlack%2FApp%2FGruntmaster.pm;h=77a8828aab25fc687a9876ee9169cd5a68612ed5;hb=c22928ed23e4213faf2529bde153a5c48e8f3629;hp=0edfe5abd99615f54778a703cef7b8ee354663ce;hpb=b7aa9f38347edb4509ccd9dea924238f79afea71;p=gruntmaster-page.git diff --git a/lib/Plack/App/Gruntmaster.pm b/lib/Plack/App/Gruntmaster.pm index 0edfe5a..77a8828 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]] },