Automattic\WooCommerce\Internal\Admin\Orders

PageController::verify_create_permission()privateWC 1.0

Verify that user has permission to create order.

Method of the class: PageController{}

No Hooks.

Return

null. Nothing.

Usage

// private - for code of main (parent) class only
$result = $this->verify_create_permission();

PageController::verify_create_permission() code WC 7.1.0

private function verify_create_permission() {
	if ( ! current_user_can( 'publish_shop_orders' ) && ! current_user_can( 'manage_woocommerce' ) ) {
		wp_die( esc_html__( 'You don\'t have permission to create a new order', 'woocommerce' ) );
	}
	if ( isset( $this->order ) ) {
		$this->verify_edit_permission();
	}
}