WC_REST_WCCOM_Site_SSR_Controller::user_has_permission()publicWC 8.6.0

Check whether user has permission to access controller's endpoints.

Method of the class: WC_REST_WCCOM_Site_SSR_Controller{}

No Hooks.

Return

true|false.

Usage

$WC_REST_WCCOM_Site_SSR_Controller = new WC_REST_WCCOM_Site_SSR_Controller();
$WC_REST_WCCOM_Site_SSR_Controller->user_has_permission( $user ) : bool;
$user(WP_USER) (required)
User object.

Changelog

Since 8.6.0 Introduced.

WC_REST_WCCOM_Site_SSR_Controller::user_has_permission() code WC 9.4.2

public function user_has_permission( $user ) : bool {
	return user_can( $user, 'manage_woocommerce' );
}