WC_REST_WCCOM_Site_Status_Controller::user_has_permission()
Check whether user has permission to access controller's endpoints.
Method of the class: WC_REST_WCCOM_Site_Status_Controller{}
No Hooks.
Return
true|false
.
Usage
$WC_REST_WCCOM_Site_Status_Controller = new WC_REST_WCCOM_Site_Status_Controller(); $WC_REST_WCCOM_Site_Status_Controller->user_has_permission( $user ): bool;
- $user(WP_USER) (required)
- User object.
Changelog
Since 8.7.0 | Introduced. |
WC_REST_WCCOM_Site_Status_Controller::user_has_permission() WC REST WCCOM Site Status Controller::user has permission code WC 9.3.3
public function user_has_permission( $user ): bool { return user_can( $user, 'install_plugins' ) && user_can( $user, 'activate_plugins' ); }