Skip to content

Commit 0660fc6

Browse files
John-leebojanz
authored andcommitted
Issue #2977052 by john.lee: Give authenticated users the "view own commerce_order" permission by default
1 parent 65345a8 commit 0660fc6

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

modules/order/commerce_order.install

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@
66
*/
77

88
use Drupal\Core\Field\BaseFieldDefinition;
9+
use Drupal\Core\Session\AccountInterface;
10+
11+
/**
12+
* Implements hook_install().
13+
*/
14+
function commerce_order_install() {
15+
// Allow authenticated users to view own orders.
16+
user_role_grant_permissions(AccountInterface::AUTHENTICATED_ROLE, ['view own commerce_order']);
17+
}
918

1019
/**
1120
* Add the 'data' field to 'commerce_order_item' entities.

0 commit comments

Comments
 (0)