projects
/
plack-app-gruntmaster.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b7aa9f3
)
Always allow users to view their own sources
author
Marius Gavrilescu
<marius@ieval.ro>
Thu, 5 Feb 2015 17:31:56 +0000
(19:31 +0200)
committer
Marius Gavrilescu
<marius@ieval.ro>
Thu, 5 Feb 2015 17:31:56 +0000
(19:31 +0200)
lib/Plack/App/Gruntmaster.pm
patch
|
blob
|
blame
|
history
diff --git
a/lib/Plack/App/Gruntmaster.pm
b/lib/Plack/App/Gruntmaster.pm
index 0edfe5abd99615f54778a703cef7b8ee354663ce..77a8828aab25fc687a9876ee9169cd5a68612ed5 100644
(file)
--- 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]]
},
This page took
0.011114 seconds
and
4
git commands to generate.