WC_REST_WCCOM_Site_Installer_Controller::user_has_permission()
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() WC REST WCCOM Site Installer Controller::user has permission code WC 9.4.2
woocommerce/includes/wccom-site/rest-api/endpoints/class-wc-rest-wccom-site-installer-controller.php
public function user_has_permission( $user ) : bool { return user_can( $user, 'install_plugins' ) && user_can( $user, 'install_themes' ); }