I created a new role assigning to it all and only all permissions under the 'Order' section, except for 'Configure order settings'.

An authenticated user with the above role can edit any order (e.g. /admin/commerce/orders/11/edit) but cannot view it (/admin/commerce/orders/11)! That causes access denied.

This behavior happens irrespective if the Order is his own or not.

CommentFileSizeAuthor
#1 view_orders_perm-2067925-1.patch561 bytesmaxrossello
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

maxrossello’s picture

Status: Active » Needs review
FileSize
561 bytes

I found the problem being in commerce_order_admin_order_view_access(), which requires the 'access administration pages' permission in addition to calling commerce_order_access().

I find this weird since editing an order just requires commerce_order_access(). Furthermore, 'access administration pages' brings in more admin menus, such as the help pages, which are more suitable to a developer than an administrator.

Patch attached

rszrama’s picture

Category: bug » support
Status: Needs review » Closed (works as designed)

This works as designed as far as the Order UI module is concerned; the order URL is defined as an administration page, so we made a decision a few releases back to start requiring this permission for the various administration interfaces we have.

brylie’s picture

Title: Can't view orders » Document permissions necessary to view orders
Version: 7.x-1.8 » 7.x-1.x-dev
Component: Order » Documentation
Category: Support request » Task
Issue summary: View changes
Status: Closed (works as designed) » Active

Wow, this totally makes sense, and I was having the same problem. Is this documented?

valentin schmid’s picture