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.
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | 3020587-12.patch | 4.27 KB | shubham.prakash |
| #9 | 3020587-9.patch | 4.45 KB | ravi.shankar |
| #6 | 3020587-2.patch | 4.56 KB | Sahil.123 |
| #2 | 3020587.patch | 4.72 KB | Sahil.123 |
Comments
Comment #2
Sahil.123 commentedPermission Issue Resolved
Comment #3
Sahil.123 commentedComment #4
gaurav.kapoor commentedComment #5
gaurav.kapoor commentedIn this patch, you have restricted permission only to admin, but PDF should be visible to the user who has placed an order as well.
Comment #6
Sahil.123 commentedComment #7
Sahil.123 commentedComment #8
gaurav.kapoor commentedComment #9
ravi.shankar commentedI have fixed it.
Comment #10
gaurav.kapoor commentedThe patch isn't working with the latest release. Please provide a new patch.
Comment #11
gaurav.kapoor commentedComment #12
shubham.prakash commentedThis patch will fix the issue of Permission to view generated PDF.
Comment #14
gaurav.kapoor commented