Skip to content
Browse files

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

…to MOODLE_22_STABLE
  • Loading branch information...
2 parents 735d8ce + 1c83b13 commit f0987e98ad51035b91230d97a7ee69adcf3d9da5 Sam Hemelryk committed Jan 16, 2012
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;

0 comments on commit f0987e9

Please sign in to comment.
Something went wrong with that request. Please try again.