mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
accesslib MDL-19730 fixing regression from MDL-19077 where has_capability fails when $USER->id=0 (so they couldn't see blocks etc)
This commit is contained in:
parent
19c9f09430
commit
024f3f9749
@ -482,7 +482,7 @@ function has_capability($capability, $context, $userid=NULL, $doanything=true) {
|
||||
if (empty($userid)) { // we must accept null, 0, '0', '' etc. in $userid
|
||||
if (empty($USER->id)) {
|
||||
// Session not set up yet.
|
||||
return false;
|
||||
$userid = 0;
|
||||
}
|
||||
$userid = $USER->id;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user