MDL-17228 Allow admins to view hidden custom profile fields.
Thanks to Alan Barrett for the fix.
This commit is contained in:
@@ -236,7 +236,11 @@ class profile_field_base {
|
||||
case PROFILE_VISIBLE_ALL:
|
||||
return true;
|
||||
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:
|
||||
return has_capability('moodle/user:update', get_context_instance(CONTEXT_SYSTEM));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user