mirror of
https://github.com/moodle/moodle.git
synced 2025-04-20 16:04:25 +02:00
Merge branch 'MDL-73684-master' of https://github.com/marinaglancy/moodle
This commit is contained in:
commit
9efbb2346a
@ -506,9 +506,11 @@ class profile_field_base {
|
||||
}
|
||||
|
||||
// Checking for mentors have capability to edit user's profile.
|
||||
$usercontext = context_user::instance($this->userid);
|
||||
if ($this->userid != $USER->id && has_capability('moodle/user:editprofile', $usercontext, $USER->id)) {
|
||||
return true;
|
||||
if ($this->userid > 0) {
|
||||
$usercontext = context_user::instance($this->userid);
|
||||
if ($this->userid != $USER->id && has_capability('moodle/user:editprofile', $usercontext, $USER->id)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user