Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-30891 fix invalid hardcoded capability check when disable legacy …

…files repo
  • Loading branch information...
commit 1c83b133431e9d8a21d6d5e8d5ff6640ff105144 1 parent f70f6e9
@skodak skodak authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 repository/lib.php
View
6 repository/lib.php
@@ -869,7 +869,11 @@ public static function get_instances($args = array()) {
}
if ($record->repositorytype == 'coursefiles') {
// coursefiles plugin needs managefiles permission
- $capability = $capability && has_capability('moodle/course:managefiles', $current_context);
+ if (!empty($current_context)) {
+ $capability = $capability && has_capability('moodle/course:managefiles', $current_context);
+ } else {
+ $capability = $capability && has_capability('moodle/course:managefiles', get_system_context());
+ }
}
if ($is_supported && $capability) {
$repositories[$repository->id] = $repository;
Please sign in to comment.
Something went wrong with that request. Please try again.