Automattic\WooCommerce\Internal\ProductDownloads\ApprovedDirectories\Admin

UI::security_check()privateWC 1.0

Makes sure the user has appropriate permissions and that we have a valid nonce.

Метод класса: UI{}

No Hooks.

Return

null. Nothing.

Usage

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

Code of UI::security_check() WC 7.1.0

private function security_check() {
	if ( ! Users::is_site_administrator() || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_REQUEST['check'] ?? '' ) ), 'modify_approved_directories' ) ) {
		wp_die( esc_html__( 'You do not have permission to modify the list of approved directories for product downloads.', 'woocommerce' ) );
	}
}