WC_REST_WCCOM_Site_Installer_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_Installer_Controller{}

No Hooks.

Return

true|false.

Usage

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

Changelog

Since 8.6.0 Introduced.

WC_REST_WCCOM_Site_Installer_Controller::user_has_permission() code WC 9.4.2

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