84 \
Magento\Framework\Acl\Builder $aclBuilder,
89 $this->_aclBuilder = $aclBuilder;
90 $this->_backendUrl = $backendUrl;
112 if (
$user ===
null) {
118 if (!$this->getAcl() ||
$user->getReloadAclFlag()) {
119 $this->setAcl($this->_aclBuilder->getAcl());
121 if (
$user->getReloadAclFlag()) {
122 $user->unsetData(
'password');
123 $user->setReloadAclFlag(
'0')->save();
138 $acl = $this->getAcl();
142 return $acl->isAllowed(
$user->getAclRole(),
$resource, $privilege);
143 }
catch (\Exception $e) {
146 return $acl->isAllowed(
$user->getAclRole(),
null, $privilege);
148 }
catch (\Exception $e) {
172 $lifetime = $this->_config->getValue(self::XML_PATH_SESSION_LIFETIME);
173 $cookieValue = $this->cookieManager->getCookie($this->
getName());
176 $this->setUpdatedAt(
time());
177 $cookieMetadata = $this->cookieMetadataFactory->createPublicCookieMetadata()
178 ->setDuration($lifetime)
179 ->setPath($this->sessionConfig->getCookiePath())
180 ->setDomain($this->sessionConfig->getCookieDomain())
181 ->setSecure($this->sessionConfig->getCookieSecure())
182 ->setHttpOnly($this->sessionConfig->getCookieHttpOnly());
183 $this->cookieManager->setPublicCookie($this->
getName(), $cookieValue, $cookieMetadata);
194 if ($this->_isFirstAfterLogin ===
null) {
195 $this->_isFirstAfterLogin = $this->
getData(
'is_first_visit',
true);
208 $this->_isFirstAfterLogin = (bool)
$value;
209 return $this->setIsFirstVisit($this->_isFirstAfterLogin);
222 if ($this->_backendUrl->useSecretKey()) {
223 $this->_backendUrl->renewSecretUrls();
227 $this->setAcl($this->_aclBuilder->getAcl());
228 $this->setUpdatedAt(
time());
isAllowed($resource, $privilege=null)
setIsFirstPageAfterLogin($value)
__construct(\Magento\Framework\App\Request\Http $request, \Magento\Framework\Session\SidResolverInterface $sidResolver, \Magento\Framework\Session\Config\ConfigInterface $sessionConfig, \Magento\Framework\Session\SaveHandlerInterface $saveHandler, \Magento\Framework\Session\ValidatorInterface $validator, \Magento\Framework\Session\StorageInterface $storage, CookieManagerInterface $cookieManager, CookieMetadataFactory $cookieMetadataFactory, \Magento\Framework\App\State $appState, \Magento\Framework\Acl\Builder $aclBuilder, \Magento\Backend\Model\UrlInterface $backendUrl, \Magento\Backend\App\ConfigInterface $config)
const XML_PATH_SESSION_LIFETIME
getData($key='', $clear=false)
destroy(array $options=null)