Merge branch 'MDL-49426-27' of git://github.com/jleyva/moodle into MOODLE_27_STABLE

This commit is contained in:
Andrew Nicols
2015-04-13 14:33:06 +08:00
+6 -1
View File
@@ -66,7 +66,12 @@ if ($fileuploaddisabled) {
// 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!