_userCollectionFactory = $userCollectionFactory; parent::__construct($context, $jsonEncoder, $authSession, $data); } /** * Class constructor * * @return void */ protected function _construct() { parent::_construct(); $roleId = $this->getRequest()->getParam('rid', false); /** @var \Magento\User\Model\ResourceModel\User\Collection $users */ $users = $this->_userCollectionFactory->create()->load(); $this->setTemplate('Magento_User::role/users.phtml') ->assign('users', $users->getItems()) ->assign('roleId', $roleId); } /** * @return $this */ protected function _prepareLayout() { $this->setChild( 'userGrid', $this->getLayout()->createBlock(\Magento\User\Block\Role\Grid\User::class, 'roleUsersGrid') ); return parent::_prepareLayout(); } /** * @return string */ public function getGridHtml() { return $this->getChildHtml('userGrid'); } }