Skip to content

Commit

Permalink
Tweak: update accessibility conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamadNateqi committed Nov 13, 2023
1 parent a565dc2 commit 502f825
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions includes/class-wcpdf-main.php
Original file line number Diff line number Diff line change
Expand Up @@ -432,15 +432,17 @@ public function generate_document_ajax() {
break;
}

if ( ! $full_permission && ! isset( $_REQUEST['my-account'] ) && ! isset( $_REQUEST['shortcode'] ) ) {
$allowed = false;
break;
}
if ( ! $full_permission ) {
if ( ! isset( $_REQUEST['my-account'] ) && ! isset( $_REQUEST['shortcode'] ) ) {
$allowed = false;
break;
}

// check if current user is owner of order IMPORTANT!!!
if ( ! current_user_can( 'view_order', $order_ids[0] ) ) {
$allowed = false;
break;
// check if current user is owner of order IMPORTANT!!!
if ( ! current_user_can( 'view_order', $order_ids[0] ) ) {
$allowed = false;
break;
}
}
break;
case 'full':
Expand Down

0 comments on commit 502f825

Please sign in to comment.