Browse files

Merge branch 'MDL-37522-published-attachment_24' of git://github.com/…

…mudrd8mz/moodle into MOODLE_24_STABLE
  • Loading branch information...
2 parents 6c2dec3 + c24b75e commit 083b0a54aa728c498b3ed98cf174f4f8bf9870c7 @stronk7 stronk7 committed Mar 4, 2013
Showing with 5 additions and 1 deletion.
  1. +5 −1 mod/workshop/lib.php
View
6 mod/workshop/lib.php
@@ -1275,7 +1275,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 {

0 comments on commit 083b0a5

Please sign in to comment.