Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
A non-admin user cannot access to his orders. In my use case I've created a view where we need info from the order and from the line items. Something like this:
Basically I need the list of the line items in one field + the order id + the date.
Well, the line items are rendered for admin users but not for authenticated users.
Proposed resolution
I found a couple of issues related #2715273: Implement full permissions for every entity type and #1935068: Non Admin users cannot access Orders but finally I decided to create a new one with a handler for that.
Comment | File | Size | Author |
---|---|---|---|
#6 | create_the_permission-2800495-6.patch | 2.99 KB | mglaman |
commerce-2-view-own-orders.patch | 3.02 KB | marthinal | |
permissions-commerce-2.png | 317.32 KB | marthinal |
Comments
Comment #2
marthinal CreditAttribution: marthinal commentedOops! :)
Comment #3
mglamanWe'll leave this here for now, but it'll be outdated by #2715273: Implement full permissions for every entity type once Entity API does this work for us.
Comment #4
mglamanComment #5
mglamanThis is no longer applying after the line item rename
Comment #6
mglamanRerolled for now. We're making headway on implementing generic permission generation and handling.
Comment #7
bojanz CreditAttribution: bojanz at Centarro commentedFixed by #2715273: Implement full permissions for every entity type, which added a "view own commerce_order". Thanks!