mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-12911 fixed permission checks; merged from MOODLE_18_STABLE
This commit is contained in:
parent
77e2e3f2b8
commit
cb3883c297
1 changed files with 2 additions and 1 deletions
|
@ -61,8 +61,9 @@
|
||||||
print_error('nologinas');
|
print_error('nologinas');
|
||||||
}
|
}
|
||||||
$context = $systemcontext;
|
$context = $systemcontext;
|
||||||
} else if (has_capability('moodle/user:loginas', $coursecontext)) {
|
} else {
|
||||||
require_login($course);
|
require_login($course);
|
||||||
|
require_capability('moodle/user:loginas', $coursecontext);
|
||||||
if (!has_capability('moodle/course:view', $coursecontext, $userid, false)) {
|
if (!has_capability('moodle/course:view', $coursecontext, $userid, false)) {
|
||||||
error('This user is not in this course!');
|
error('This user is not in this course!');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue