mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-58220 auth_oauth2: Linked logins only 4U
You can only manage your own linked logins - never anyone elses.
This commit is contained in:
parent
427fa27cf4
commit
340659cc29
@ -38,9 +38,10 @@ function auth_oauth2_extend_navigation_user_settings(navigation_node $useraccoun
|
||||
context_user $context,
|
||||
stdClass $course,
|
||||
context_course $coursecontext) {
|
||||
global $USER;
|
||||
|
||||
if (!\core\session\manager::is_loggedinas()) {
|
||||
if (has_capability('auth/oauth2:managelinkedlogins', $context)) {
|
||||
if (has_capability('auth/oauth2:managelinkedlogins', $context) && $user->id == $USER->id) {
|
||||
|
||||
$parent = $useraccount->parent->find('useraccount', navigation_node::TYPE_CONTAINER);
|
||||
$parent->add(get_string('linkedlogins', 'auth_oauth2'), new moodle_url('/auth/oauth2/linkedlogins.php'));
|
||||
|
Loading…
x
Reference in New Issue
Block a user