public static function can_read_user_in_course($userid, $courseid) {
        $capability = 'moodle/competency:usercompetencyview';
        return has_capability($capability, context_course::instance($courseid))
            || static::can_read_user($userid);
    }
public static function can_read_user_in_course($userid, $courseid) {
        $capability = 'moodle/competency:usercompetencyview';
        return has_capability($capability, context_course::instance($courseid))
            || static::can_read_user($userid);
    }
public static function can_read_user_in_course ( $ userid , $ courseid ) { $ capability = 'moodle/competency:usercompetencyview' ; return has_capability ( $ capability , context_course :: instance ( $ courseid ) ) || static :: can_read_user ( $ userid ) ; }
Can the current user read the user competencies of a user in a course?

@param int $userid The user ID the competency belongs to.
@param int $courseid The course ID.
@return bool
Can the current user read the user competencies of a user in a course?