Automattic\WooCommerce\Internal\Admin\Orders

PageController::verify_edit_permission()privateWC 1.0

Verify that user has permission to edit orders.

{} Это метод класса: PageController{}

Хуков нет.

Возвращает

null. Ничего.

Использование

// private - только в коде основоного (родительского) класса
$result = $this->verify_edit_permission();

Код PageController::verify_edit_permission() WC 6.9.4

private function verify_edit_permission() {
	if ( 'edit_order' === $this->current_action && ( ! isset( $this->order ) || ! $this->order ) ) {
		wp_die( esc_html__( 'You attempted to edit an order that does not exist. Perhaps it was deleted?', 'woocommerce' ) );
	}
	if ( ! current_user_can( 'edit_others_shop_orders' ) && ! current_user_can( 'manage_woocommerce' ) ) {
		wp_die( esc_html__( 'You do not have permission to edit this order', 'woocommerce' ) );
	}
}