Skip to content

Commit

Permalink
Merge branch 'MDL-49426-master' of git://github.com/jleyva/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Apr 14, 2015
2 parents 85519ef + f7b443c commit b522e25
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion webservice/upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@

// check the user can manage his own files (can upload)
$context = context_user::instance($USER->id);
require_capability('moodle/user:manageownfiles', $context);

// Allow allways to upload files to the draft area, no matter if the user can't manage his own files.
// Files required by other webservices (like mod_assign ones) must be uploaded to the draft area.
if ($filearea === 'private') {
require_capability('moodle/user:manageownfiles', $context);
}

if ($filearea !== 'private' and $filearea !== 'draft') {
// Do not dare to allow more areas here!
Expand Down

0 comments on commit b522e25

Please sign in to comment.