Skip to content

Commit 50b1b43

Browse files
committed
MAGETWO-94077: [2.3] Admin user with permissions for 1 website should not be able to view the All Store Views scope on a product
- Added store id to product link on product grid page if user has restricted access to product
1 parent e981850 commit 50b1b43

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ public function addWebsiteNamesToResult()
768768
}
769769

770770
/**
771-
* {@inheritdoc}
771+
* @inheritdoc
772772
*/
773773
public function load($printQuery = false, $logQuery = false)
774774
{
@@ -819,6 +819,7 @@ protected function doAddWebsiteNamesToResult()
819819
foreach ($this as $product) {
820820
if (isset($productWebsites[$product->getId()])) {
821821
$product->setData('websites', $productWebsites[$product->getId()]);
822+
$product->setData('website_ids', $productWebsites[$product->getId()]);
822823
}
823824
}
824825
return $this;
@@ -1115,11 +1116,11 @@ public function getSelectCountSql()
11151116
/**
11161117
* Get SQL for get record count
11171118
*
1118-
* @param null $select
1119+
* @param Select $select
11191120
* @param bool $resetLeftJoins
1120-
* @return \Magento\Framework\DB\Select
1121+
* @return Select
11211122
*/
1122-
protected function _getSelectCountSql($select = null, $resetLeftJoins = true)
1123+
protected function _getSelectCountSql(?Select $select = null, $resetLeftJoins = true)
11231124
{
11241125
$this->_renderFilters();
11251126
$countSelect = $select === null ? $this->_getClearSelect() : $this->_buildClearSelect($select);
@@ -1581,7 +1582,7 @@ public function addAttributeToFilter($attribute, $condition = null, $joinType =
15811582
}
15821583

15831584
/**
1584-
* {@inheritdoc}
1585+
* @inheritdoc
15851586
* @since 101.0.0
15861587
*/
15871588
protected function getEntityPkName(\Magento\Eav\Model\Entity\AbstractEntity $entity)

0 commit comments

Comments
 (0)