Automattic\WooCommerce\Api\Infrastructure
Principal::can_introspect
Whether this principal may run GraphQL schema introspection on the endpoint.
Implementing can_introspect() is opt-in for plugin principal classes, a principal that doesn't define it is denied by default. Plugins building authenticated endpoints should make an explicit decision per principal model rather than inheriting an introspection policy by accident.
Method of the class: Principal{}
No Hooks.
Returns
null. Nothing (null).
Usage
$Principal = new Principal(); $Principal->can_introspect(): bool;
Principal::can_introspect() Principal::can introspect code WC 10.9.1
public function can_introspect(): bool {
return user_can( $this->user, 'manage_woocommerce' );
}