cancel
Showing results for 
Search instead for 
Did you mean: 

How to control displayed catalogs depending on login account

How to control displayed catalogs depending on login account

Hi,

 

I'd like to ask how to extend catalog list screen of backend.

 

* What I want to do

Display the list of only products added by login user

(by default, all products are displayed not depending on login user)

 

* Issues

In order to control process depending on login account, I must call this class.

\Magento\Backend\Model\Auth\Session

 

Also in order to realize this function, I think I must override this class.

vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php

 

But in this class, I can't call auth session class and get error log.

main.CRITICAL: Recoverable Error: Argument 20 passed to Magento\Catalog\Model\ResourceModel\Product\Collection::__construct() must be an instance of Magento\Backend\Model\Auth\Session, null given

How can I control product list depending on login account?