]> iEval git - gruntmaster-page.git/commitdiff
Merge branch 'master' into newmc
authorMarius Gavrilescu <marius@ieval.ro>
Thu, 5 Feb 2015 17:37:14 +0000 (19:37 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Thu, 5 Feb 2015 17:37:14 +0000 (19:37 +0200)
lib/Plack/App/Gruntmaster.pm
lib/Plack/App/Gruntmaster/HTML.pm

index bd11fe04e33c429dd3ef7ed8cc7342ddd5cead95..45cdfd1c5107e7babaad66a51a1f0a4885a5d406 100644 (file)
@@ -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]]
                },
index 87dc8b48837fa23dddbad6c30e0a3fe336596284..8e36af534b5b3b11af75619472d3a57b4f612542 100644 (file)
@@ -255,6 +255,7 @@ sub process_st {
                my ($data, $th) = @_;
                $th->attr(class => undef);
                $th->namedlink(@$data);
+               $th->find('a')->edit_href(sub{s/$/?contest=$args{args}{contest}/});
        };
        $tree->fclass('problem')->iter3($args{problems}, $pbiter);
        my $iter = sub {
This page took 0.026465 seconds and 4 git commands to generate.