Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions commerce_stock.permissions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
'administer commerce_stock':
title: 'Administer Commerce Stock'
description: 'Use Commerce Stock administrative pages and functionality.'
'restrict access': TRUE
2 changes: 1 addition & 1 deletion commerce_stock.routing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ commerce_stock.stock_config:
_form: '\Drupal\commerce_stock\Form\StockConfigForm'
_title: 'Configure Commerce Stock'
requirements:
_permission: 'access administration pages'
_permission: 'administer commerce_stock'
options:
_admin_route: TRUE
4 changes: 2 additions & 2 deletions modules/ui/commerce_stock_ui.routing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ commerce_stock_ui.stock_transactions1:
_form: '\Drupal\commerce_stock_ui\Form\StockTransactions1'
_title: 'Create stock transaction'
requirements:
_access: 'TRUE'
_permission: 'administer commerce_stock'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creating transactions should not be for stock admins especially as this is one of the 3 Entry systems the stock field supports.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but we certainly shouldn't grant everyone access to this route. :)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is also true. Should probably be the same permission that allows editing of products


commerce_stock_ui.stock_transactions2:
path: '/admin/commerce/config/stock/transactions2'
defaults:
_form: '\Drupal\commerce_stock_ui\Form\StockTransactions2'
_title: 'Create stock transaction'
requirements:
_access: 'TRUE'
_permission: 'administer commerce_stock'
1 change: 1 addition & 0 deletions tests/src/Functional/StockBrowserTestBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ protected function getAdministratorPermissions() {
'administer commerce_product_variation fields',
'administer commerce_product_variation display',
'access commerce_product overview',
'administer commerce_stock',
], parent::getAdministratorPermissions());
}

Expand Down