Implementing attachment restrictions requires us to conditionally check the user permissions and hide the attachment for unauthorized users. So, we need a filter that can modify the output of attachments in list. Let's add a filter to the file list code inside wpqpa_file_attachment_list. We need to replace the following code:
$display .= ' <div class="wpqpa-file-item" id="PF'.$file_row->id.'" data-file-id="'.$file_row->id.'" > <div class="wpqpa-file-item-row" > <div class="wpqpa-file-item-name wpqpa-files-list-name" >'.$file_row->file_name.'</div> <div class="wpqpa-file-item-download" ><a href="'.$url.'" >'.__("Download","wpqpa").'</a></div> <div class="wpqpa-clear"></div> </div> <div class="wpqpa-clear"></div> ...