mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
MDL-17228 Allow admins to view hidden custom profile fields.
Thanks to Alan Barrett for the fix. Merged from MOODLE_19_STABLE
This commit is contained in:
parent
b364b9ce03
commit
76727901a6
@ -242,7 +242,11 @@ class profile_field_base {
|
|||||||
case PROFILE_VISIBLE_ALL:
|
case PROFILE_VISIBLE_ALL:
|
||||||
return true;
|
return true;
|
||||||
case PROFILE_VISIBLE_PRIVATE:
|
case PROFILE_VISIBLE_PRIVATE:
|
||||||
return ($this->userid == $USER->id);
|
if ($this->userid == $USER->id) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return has_capability('moodle/user:update', get_context_instance(CONTEXT_SYSTEM));
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
return has_capability('moodle/user:update', get_context_instance(CONTEXT_SYSTEM));
|
return has_capability('moodle/user:update', get_context_instance(CONTEXT_SYSTEM));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user