userContext = $userContext; $this->roleCollectionFactory = $roleCollectionFactory; } /** * {@inheritdoc} */ public function getAclRoleId() { $userId = $this->userContext->getUserId(); $userType = $this->userContext->getUserType(); $roleCollection = $this->roleCollectionFactory->create(); /** @var Role $role */ $role = $roleCollection->setUserFilter($userId, $userType)->getFirstItem(); if (!$role->getId()) { return null; } return $role->getId(); } }