Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge remote-tracking branch 'skodak/w03_MDL-30891_m22_repository' in…

…to MOODLE_22_STABLE
  • Loading branch information...
commit f0987e98ad51035b91230d97a7ee69adcf3d9da5 2 parents 735d8ce + 1c83b13
@samhemelryk samhemelryk 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.