Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
RoleLocator.php
Go to the documentation of this file.
1 <?php
7 
12 class RoleLocator implements \Magento\Framework\Authorization\RoleLocatorInterface
13 {
19  protected $_session;
20 
24  public function __construct(\Magento\Backend\Model\Auth\Session $session)
25  {
26  $this->_session = $session;
27  }
28 
34  public function getAclRoleId()
35  {
36  if ($this->_session->hasUser()) {
37  return $this->_session->getUser()->getAclRole();
38  }
39  return null;
40  }
41 }
__construct(\Magento\Backend\Model\Auth\Session $session)
Definition: RoleLocator.php:24