Hello,

while testing if the modules fits my requirements I found out that there is no permission check implemented. Is this by design or by accident?

I figure it's a privacy problem to be able to download any invoice simply by trying order numbers.

The following could be one to solve it, but maybe there's a also a better way.

1. Implement a new permission "view-own-commerce-order-pdf" (similar one "view-own-commerce-order-pdf").The disadvantage here lies in anonymous orders. If the permission is set to anything but `Guest`, there's no chance for a customer to view the invoice.

2. Additionally it would make sense to add a long random string to the URL. This makes guessing URLs to retrieve invoices way more difficult.

Both methods could be used in combination: if it's required to have anonymous customers that are able to retrieve the PDF, on could set the permission to "Guest" and still have the benefit of cryptic URLs.

I'm didn't have the chance to dive into D8 module development, but I would like to get my feet wet.

Comments

Daniel Wentsch created an issue. See original summary.

Sahil.123’s picture

StatusFileSize
new4.72 KB

Permission Issue Resolved

Sahil.123’s picture

Status: Active » Needs review
gaurav.kapoor’s picture

Status: Needs review » Needs work
gaurav.kapoor’s picture

In this patch, you have restricted permission only to admin, but PDF should be visible to the user who has placed an order as well.

Sahil.123’s picture

StatusFileSize
new4.56 KB
Sahil.123’s picture

Status: Needs work » Needs review
gaurav.kapoor’s picture

Assigned: Unassigned » gaurav.kapoor
Status: Needs review » Needs work
ravi.shankar’s picture

Status: Needs work » Needs review
StatusFileSize
new4.45 KB

I have fixed it.

gaurav.kapoor’s picture

Status: Needs review » Needs work

The patch isn't working with the latest release. Please provide a new patch.

gaurav.kapoor’s picture

Assigned: gaurav.kapoor » Unassigned
shubham.prakash’s picture

Status: Needs work » Needs review
StatusFileSize
new4.27 KB

This patch will fix the issue of Permission to view generated PDF.

gaurav.kapoor’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.