WordPress at a glance
function is not described

Automattic\WooCommerce\Admin\API

Themes::upload_theme_permissions_check() public WC 1.0

Check whether a given request has permission to edit upload plugins/themes.

{} It's a method of the class: Themes{}

No Hooks.

Return

WP_Error|true|false. Nothing.

Usage

$Themes = new Themes();
$Themes->upload_theme_permissions_check( $request );
$request(WP_REST_Request) (required)
Full details about the request.

Code of Themes::upload_theme_permissions_check() WC 5.2.2

<?php
public function upload_theme_permissions_check( $request ) {
	if ( ! current_user_can( 'upload_themes' ) ) {
		return new \WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you are not allowed to install themes on this site.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
	}

	return true;
}