original_string: public static function delete_linked_login($linkedloginid) {
          $login = new linked_login($linkedloginid);
          $userid = $login->get('userid');
  
          if (\core\session\manager::is_loggedinas()) {
              throw new moodle_exception('notwhileloggedinas', 'auth_oauth2');
          }
  
          $context = context_user::instance($userid);
          require_capability('auth/oauth2:managelinkedlogins', $context);
  
          $login->delete();
      }
code: public static function delete_linked_login($linkedloginid) {
          $login = new linked_login($linkedloginid);
          $userid = $login->get('userid');
  
          if (\core\session\manager::is_loggedinas()) {
              throw new moodle_exception('notwhileloggedinas', 'auth_oauth2');
          }
  
          $context = context_user::instance($userid);
          require_capability('auth/oauth2:managelinkedlogins', $context);
  
          $login->delete();
      }
code_tokens: public static function delete_linked_login ( $ linkedloginid ) { $ login = new linked_login ( $ linkedloginid ) ; $ userid = $ login -> get ( 'userid' ) ; if ( \ core \ session \ manager :: is_loggedinas ( ) ) { throw new moodle_exception ( 'notwhileloggedinas' , 'auth_oauth2' ) ; } $ context = context_user :: instance ( $ userid ) ; require_capability ( 'auth/oauth2:managelinkedlogins' , $ context ) ; $ login -> delete ( ) ; }
docstring: Delete linked login
  
  Requires auth/oauth2:managelinkedlogins capability at the user context.
  
  @param int $linkedloginid
  @return boolean
docstring_tokens: Delete linked login