public static function can_read_user($userid) {
        $capability = 'moodle/competency:usercompetencyview';
        return has_capability($capability, context_user::instance($userid))
            || plan::can_read_user($userid);
    }
public static function can_read_user($userid) {
        $capability = 'moodle/competency:usercompetencyview';
        return has_capability($capability, context_user::instance($userid))
            || plan::can_read_user($userid);
    }
public static function can_read_user ( $ userid ) { $ capability = 'moodle/competency:usercompetencyview' ; return has_capability ( $ capability , context_user :: instance ( $ userid ) ) || plan :: can_read_user ( $ userid ) ; }
Can the current user read a user's competency?

@param int $userid The user ID the competency belongs to.
@return bool
Can the current user read a user s competency?