original_string: protected function current_user_is_parent_role() {
          global $USER, $DB;
          if ($this->useridtouseforparentchecks && $this->useridtouseforparentchecks != $USER->id) {
              $usercontext = context_user::instance($this->useridtouseforparentchecks, MUST_EXIST);
              if (!has_capability('moodle/user:viewdetails', $usercontext)) {
                  return false;
              }
              if ($DB->record_exists('role_assignments', array('userid' => $USER->id, 'contextid' => $usercontext->id))) {
                  return true;
              }
          }
          return false;
      }
code: protected function current_user_is_parent_role() {
          global $USER, $DB;
          if ($this->useridtouseforparentchecks && $this->useridtouseforparentchecks != $USER->id) {
              $usercontext = context_user::instance($this->useridtouseforparentchecks, MUST_EXIST);
              if (!has_capability('moodle/user:viewdetails', $usercontext)) {
                  return false;
              }
              if ($DB->record_exists('role_assignments', array('userid' => $USER->id, 'contextid' => $usercontext->id))) {
                  return true;
              }
          }
          return false;
      }
code_tokens: protected function current_user_is_parent_role ( ) { global $ USER , $ DB ; if ( $ this -> useridtouseforparentchecks && $ this -> useridtouseforparentchecks != $ USER -> id ) { $ usercontext = context_user :: instance ( $ this -> useridtouseforparentchecks , MUST_EXIST ) ; if ( ! has_capability ( 'moodle/user:viewdetails' , $ usercontext ) ) { return false ; } if ( $ DB -> record_exists ( 'role_assignments' , array ( 'userid' => $ USER -> id , 'contextid' => $ usercontext -> id ) ) ) { return true ; } } return false ; }
docstring: Returns true if the current user is a parent of the user being currently viewed.
  
  If the current user is not viewing another user, or if the current user does not hold any parent roles over the
  other user being viewed this function returns false.
  In order to set the user for whom we are checking against you must call {@link set_userid_for_parent_checks()}
  
  @since Moodle 2.4
  @return bool
docstring_tokens: Returns true if the current user is a parent of the user being currently viewed .