Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/2.4-develop' into MC-29276
Browse files Browse the repository at this point in the history
  • Loading branch information
bubasuma committed Mar 5, 2020
2 parents b6f8433 + 39914f7 commit 488dfd0
Show file tree
Hide file tree
Showing 1,091 changed files with 14,060 additions and 5,790 deletions.
23 changes: 0 additions & 23 deletions .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -37,29 +37,6 @@

DirectoryIndex index.php

<IfModule mod_php5.c>
############################################
## adjust memory limit

php_value memory_limit 756M
php_value max_execution_time 18000

############################################
## disable automatic session start
## before autoload was initialized

php_flag session.auto_start off

############################################
## enable resulting html compression

#php_flag zlib.output_compression on

###########################################
## disable user agent verification to not break multiple image upload

php_flag suhosin.session.cryptua off
</IfModule>
<IfModule mod_php7.c>
############################################
## adjust memory limit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="LoginAsAdmin">
<actionGroup name="AdminLoginActionGroup">
<conditionalClick selector="{{AdminUsageNotificationSection.adminUsageDontAllowButton}}" dependentSelector="{{AdminUsageNotificationSection.adminUsageDontAllowButton}}" visible="true" stepKey="clickDontAllowButtonIfVisible" before="closeAdminNotification"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="LoginAdminWithCredentialsActionGroup">
<actionGroup name="LoginAdminWithCredentialsActionGroup" deprecated="Use AdminLoginActionGroup instead">
<conditionalClick selector="{{AdminUsageNotificationSection.adminUsageDontAllowButton}}" dependentSelector="{{AdminUsageNotificationSection.adminUsageDontAllowButton}}" visible="true" stepKey="clickDontAllowButtonIfVisible" before="closeAdminNotification"/>
</actionGroup>
<actionGroup name="LoginAsAdmin" deprecated="Use AdminLoginActionGroup instead">
<conditionalClick selector="{{AdminUsageNotificationSection.adminUsageDontAllowButton}}" dependentSelector="{{AdminUsageNotificationSection.adminUsageDontAllowButton}}" visible="true" stepKey="clickDontAllowButtonIfVisible" before="closeAdminNotification"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/>
</before>
<after>
<actionGroup ref="logout" stepKey="logout"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
</after>
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToSystemNotificationPage">
<argument name="menuUiId" value="{{AdminMenuSystem.dataUiId}}"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<actionGroup ref = "LoginAsAdmin" stepKey="loginAsAdmin"/>
</before>
<after>
<actionGroup ref="logout" stepKey="logout"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
</after>

<!--Navigate through Advanced Reporting button on dashboard to Sign Up page-->
Expand All @@ -35,4 +35,4 @@
<switchToNextTab stepKey="switchToNewTab"/>
<seeInCurrentUrl url="advancedreporting.rjmetrics.com/report" stepKey="seeAssertAdvancedReportingPageUrl"/>
</test>
</tests>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/>
</before>
<after>
<actionGroup ref="logout" stepKey="logout"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
</after>
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateAdvancedReportingPage">
<argument name="menuUiId" value="{{AdminMenuReports.dataUiId}}"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
<group value="analytics"/>
</annotations>
<after>
<actionGroup ref="logout" stepKey="logoutOfAdmin"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/>
</after>
<actionGroup ref="LoginActionGroup" stepKey="loginAsAdmin"/>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
<amOnPage url="{{AdminConfigGeneralAnalyticsPage.url}}" stepKey="amOnAdminConfig"/>
<selectOption selector="{{AdminConfigAdvancedReportingSection.advancedReportingService}}" userInput="Enable" stepKey="selectAdvancedReportingServiceEnabled"/>
<see selector="{{AdminConfigAdvancedReportingSection.advancedReportingIndustryLabel}}" userInput="Industry" stepKey="seeAdvancedReportingIndustryLabel"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
<group value="analytics"/>
</annotations>
<after>
<actionGroup ref="logout" stepKey="logoutOfAdmin"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/>
</after>
<actionGroup ref="LoginActionGroup" stepKey="loginAsAdmin"/>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
<amOnPage url="{{AdminConfigGeneralAnalyticsPage.url}}" stepKey="amOnAdminConfig"/>
<see selector="{{AdminConfigAdvancedReportingSection.advancedReportingServiceLabel}}" userInput="Advanced Reporting Service" stepKey="seeAdvancedReportingServiceLabelEnabled"/>
<selectOption selector="{{AdminConfigAdvancedReportingSection.advancedReportingService}}" userInput="Enable" stepKey="selectAdvancedReportingServiceEnabled"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<group value="analytics"/>
</annotations>

<actionGroup ref="LoginActionGroup" stepKey="loginAsAdmin"/>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
<amOnPage url="{{AdminConfigGeneralAnalyticsPage.url}}" stepKey="amOnAdminConfig"/>
<selectOption selector="{{AdminConfigAdvancedReportingSection.advancedReportingService}}" userInput="Enable" stepKey="selectAdvancedReportingServiceEnabled"/>
<see selector="{{AdminConfigAdvancedReportingSection.advancedReportingIndustryLabel}}" userInput="Industry" stepKey="seeAdvancedReportingIndustryLabel"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
<before>
<createData entity="adminNoReportRole" stepKey="noReportUserRole"/>
<createData entity="adminNoReport" stepKey="noReportUser"/>
<actionGroup ref="LoginActionGroup" stepKey="loginAsAdmin"/>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
</before>
<after>
<actionGroup ref="logout" stepKey="logoutOfAdmin"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/>
</after>
<amOnPage url="{{AdminUsersPage.url}}" stepKey="amOnAdminUsersPage"/>
<fillField selector="{{AdminUserGridSection.usernameFilterTextField}}" userInput="$$noReportUser.username$$" stepKey="fillUsernameSearch"/>
Expand All @@ -51,7 +51,7 @@
<scrollTo selector="{{AdminConfigAdvancedReportingSection.advancedReportingMenuItem}}" stepKey="scrollToMenuItem"/>
<!--<see stepKey="seeAdvancedReportingConfigMenuItem" selector="{{AdminConfigAdvancedReportingSection.advancedReportingMenuItem}}" userInput="Advanced Reporting"/>-->
<seeElementInDOM selector="{{AdminConfigAdvancedReportingSection.advancedReportingMenuItem}}" stepKey="seeAdvancedReportingConfigMenuItem"/>
<actionGroup ref="logout" stepKey="logoutOfAdmin2"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin2"/>

<amOnPage url="{{AdminLoginPage.url}}" stepKey="amOnAdminLoginPage"/>
<fillField selector="{{AdminLoginFormSection.username}}" userInput="$$noReportUser.username$$" stepKey="fillUsernameNoReport"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
<group value="analytics"/>
</annotations>
<after>
<actionGroup ref="logout" stepKey="logoutOfAdmin"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/>
</after>
<actionGroup ref="LoginActionGroup" stepKey="loginAsAdmin"/>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
<amOnPage url="{{AdminConfigGeneralAnalyticsPage.url}}" stepKey="amOnAdminConfig"/>
<selectOption selector="{{AdminConfigAdvancedReportingSection.advancedReportingService}}" userInput="Enable" stepKey="selectAdvancedReportingServiceEnabled"/>
<selectOption selector="{{AdminConfigAdvancedReportingSection.advancedReportingIndustry}}" userInput="Apps and Games" stepKey="selectAdvancedReportingIndustry"/>
Expand Down
47 changes: 27 additions & 20 deletions app/code/Magento/Authorization/Model/Acl/Loader/Role.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,46 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\Authorization\Model\Acl\Loader;

use Magento\Authorization\Model\Acl\Role\Group as RoleGroup;
use Magento\Authorization\Model\Acl\Role\GroupFactory;
use Magento\Authorization\Model\Acl\Role\User as RoleUser;
use Magento\Framework\App\ObjectManager;
use Magento\Authorization\Model\Acl\Role\UserFactory;
use Magento\Framework\Acl\Data\CacheInterface;
use Magento\Framework\Acl\LoaderInterface;
use Magento\Framework\App\ResourceConnection;
use Magento\Framework\Serialize\Serializer\Json;

class Role implements \Magento\Framework\Acl\LoaderInterface
/**
* Acl Role Loader
*/
class Role implements LoaderInterface
{
/**
* Cache key for ACL roles cache
*/
const ACL_ROLES_CACHE_KEY = 'authorization_role_cached_data';

/**
* @var \Magento\Framework\App\ResourceConnection
* @var ResourceConnection
*/
protected $_resource;

/**
* @var \Magento\Authorization\Model\Acl\Role\GroupFactory
* @var GroupFactory
*/
protected $_groupFactory;

/**
* @var \Magento\Authorization\Model\Acl\Role\UserFactory
* @var UserFactory
*/
protected $_roleFactory;

/**
* @var \Magento\Framework\Acl\Data\CacheInterface
* @var CacheInterface
*/
private $aclDataCache;

Expand All @@ -48,28 +57,26 @@ class Role implements \Magento\Framework\Acl\LoaderInterface
private $cacheKey;

/**
* @param \Magento\Authorization\Model\Acl\Role\GroupFactory $groupFactory
* @param \Magento\Authorization\Model\Acl\Role\UserFactory $roleFactory
* @param \Magento\Framework\App\ResourceConnection $resource
* @param \Magento\Framework\Acl\Data\CacheInterface $aclDataCache
* @param GroupFactory $groupFactory
* @param UserFactory $roleFactory
* @param ResourceConnection $resource
* @param CacheInterface $aclDataCache
* @param Json $serializer
* @param string $cacheKey
*/
public function __construct(
\Magento\Authorization\Model\Acl\Role\GroupFactory $groupFactory,
\Magento\Authorization\Model\Acl\Role\UserFactory $roleFactory,
\Magento\Framework\App\ResourceConnection $resource,
\Magento\Framework\Acl\Data\CacheInterface $aclDataCache = null,
Json $serializer = null,
GroupFactory $groupFactory,
UserFactory $roleFactory,
ResourceConnection $resource,
CacheInterface $aclDataCache,
Json $serializer,
$cacheKey = self::ACL_ROLES_CACHE_KEY
) {
$this->_resource = $resource;
$this->_groupFactory = $groupFactory;
$this->_roleFactory = $roleFactory;
$this->aclDataCache = $aclDataCache ?: ObjectManager::getInstance()->get(
\Magento\Framework\Acl\Data\CacheInterface::class
);
$this->serializer = $serializer ?: ObjectManager::getInstance()->get(Json::class);
$this->_resource = $resource;
$this->aclDataCache = $aclDataCache;
$this->serializer = $serializer;
$this->cacheKey = $cacheKey;
}

Expand Down
44 changes: 25 additions & 19 deletions app/code/Magento/Authorization/Model/Acl/Loader/Rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,38 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\Authorization\Model\Acl\Loader;

use Magento\Framework\App\ObjectManager;
use Magento\Framework\Acl\Data\CacheInterface;
use Magento\Framework\Acl\LoaderInterface;
use Magento\Framework\Acl\RootResource;
use Magento\Framework\App\ResourceConnection;
use Magento\Framework\Serialize\Serializer\Json;

class Rule implements \Magento\Framework\Acl\LoaderInterface
/**
* Acl Rule Loader
*/
class Rule implements LoaderInterface
{
/**
* Rules array cache key
*/
const ACL_RULE_CACHE_KEY = 'authorization_rule_cached_data';

/**
* @var \Magento\Framework\App\ResourceConnection
* @var ResourceConnection
*/
protected $_resource;

/**
* @var \Magento\Framework\Acl\RootResource
* @var RootResource
*/
private $_rootResource;

/**
* @var \Magento\Framework\Acl\Data\CacheInterface
* @var CacheInterface
*/
private $aclDataCache;

Expand All @@ -41,28 +49,26 @@ class Rule implements \Magento\Framework\Acl\LoaderInterface
private $cacheKey;

/**
* @param \Magento\Framework\Acl\RootResource $rootResource
* @param \Magento\Framework\App\ResourceConnection $resource
* @param array $data
* @param \Magento\Framework\Acl\Data\CacheInterface $aclDataCache
* @param RootResource $rootResource
* @param ResourceConnection $resource
* @param CacheInterface $aclDataCache
* @param Json $serializer
* @param array $data
* @param string $cacheKey
* @SuppressWarnings(PHPMD.UnusedFormalParameter):
*/
public function __construct(
\Magento\Framework\Acl\RootResource $rootResource,
\Magento\Framework\App\ResourceConnection $resource,
RootResource $rootResource,
ResourceConnection $resource,
CacheInterface $aclDataCache,
Json $serializer,
array $data = [],
\Magento\Framework\Acl\Data\CacheInterface $aclDataCache = null,
Json $serializer = null,
$cacheKey = self::ACL_RULE_CACHE_KEY
) {
$this->_resource = $resource;
$this->_rootResource = $rootResource;
$this->aclDataCache = $aclDataCache ?: ObjectManager::getInstance()->get(
\Magento\Framework\Acl\Data\CacheInterface::class
);
$this->serializer = $serializer ?: ObjectManager::getInstance()->get(Json::class);
$this->_resource = $resource;
$this->aclDataCache = $aclDataCache;
$this->serializer = $serializer;
$this->cacheKey = $cacheKey;
}

Expand Down Expand Up @@ -104,7 +110,7 @@ private function getRulesArray()
return $this->serializer->unserialize($rulesCachedData);
}

$ruleTable = $this->_resource->getTableName("authorization_rule");
$ruleTable = $this->_resource->getTableName('authorization_rule');
$connection = $this->_resource->getConnection();
$select = $connection->select()
->from(['r' => $ruleTable]);
Expand Down
Loading

0 comments on commit 488dfd0

Please sign in to comment.