Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-37522 Serve images from published submissions

If the user is allowed to see the published submission, she must be also
able to see images in it (both embedded into the text as well as
attached to the submission). See the logic in submission.php as a
reference.
  • Loading branch information...
commit ce5940cc94a4e76c7f4c08edaec0b2c2de8fc87f 1 parent 215c189
@mudrd8mz mudrd8mz authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 mod/workshop/lib.php
View
6 mod/workshop/lib.php
@@ -1249,7 +1249,11 @@ function workshop_pluginfile($course, $cm, $context, $filearea, array $args, $fo
// make sure the user is allowed to see the file
if (empty($submission->example)) {
if ($USER->id != $submission->authorid) {
- if (!$DB->record_exists('workshop_assessments', array('submissionid' => $submission->id, 'reviewerid' => $USER->id))) {
+ if ($submission->published == 1 and $workshop->phase == 50
+ and has_capability('mod/workshop:viewpublishedsubmissions', $context)) {
+ // Published submission, we can go (workshop does not take the group mode
+ // into account in this case yet).
+ } else if (!$DB->record_exists('workshop_assessments', array('submissionid' => $submission->id, 'reviewerid' => $USER->id))) {
if (!has_capability('mod/workshop:viewallsubmissions', $context)) {
send_file_not_found();
} else {
Please sign in to comment.
Something went wrong with that request. Please try again.