mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDL-12382 allow admins to access any course - including courses where they have guest role and course does not allow guests; merged from MOODLE_19_STABLE
This commit is contained in:
parent
93964e1aeb
commit
5f431c1bad
@ -1957,6 +1957,11 @@ function require_login($courseorid=0, $autologinguest=true, $cm=null) {
|
||||
/// If the user is a guest then treat them according to the course policy about guests
|
||||
|
||||
if (has_capability('moodle/legacy:guest', $COURSE->context, NULL, false)) {
|
||||
if (has_capability('moodle/site:doanything', $sysctx)) {
|
||||
// administrators must be able to access any course - even if somebody gives them guest access
|
||||
return true;
|
||||
}
|
||||
|
||||
switch ($COURSE->guest) { /// Check course policy about guest access
|
||||
|
||||
case 1: /// Guests always allowed
|
||||
|
Loading…
x
Reference in New Issue
Block a user