Skip to content

Commit b20a49d

Browse files
committed
MAGETWO-60424: Remove Acl cache usage in Acl Builder
- CR notices
1 parent 7fcf9c1 commit b20a49d

File tree

7 files changed

+16
-4
lines changed

7 files changed

+16
-4
lines changed

app/code/Magento/Authorization/Model/ResourceModel/Rules.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ class Rules extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
2525
* Acl object cache
2626
*
2727
* @var \Magento\Framework\Acl\CacheInterface
28-
* @deprecated
28+
* @deprecated since 2.2 due to native serialization elimination.
29+
* Use data cache \Magento\Framework\Acl\Data\CacheInterface instead.
2930
*/
3031
protected $_aclCache;
3132

app/code/Magento/Authorization/Test/Unit/Model/ResourceModel/RulesTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
/**
1010
* Unit test for Rules resource model.
1111
*
12+
* Covers control flow logic.
13+
* The resource saving is covered with integration test in \Magento\Authorization\Model\RulesTest.
14+
*
1215
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1316
*/
1417
class RulesTest extends \PHPUnit_Framework_TestCase

app/code/Magento/User/Model/ResourceModel/User.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ class User extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
1919
{
2020
/**
2121
* @var \Magento\Framework\Acl\CacheInterface
22-
* @deprecated
22+
* @deprecated since 2.2 due to native serialization elimination.
23+
* Use data cache \Magento\Framework\Acl\Data\CacheInterface instead.
2324
*/
2425
protected $_aclCache;
2526

app/etc/di.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,11 @@
157157
<preference for="Magento\Framework\DataObject\IdentityGeneratorInterface" type="Magento\Framework\DataObject\IdentityService" />
158158
<preference for="Magento\Framework\Serialize\SerializerInterface" type="Magento\Framework\Serialize\Serializer\Json" />
159159
<type name="Magento\Framework\Model\ResourceModel\Db\TransactionManager" shared="false" />
160+
<type name="Magento\Framework\Acl\Data\Cache">
161+
<arguments>
162+
<argument name="aclBuilder" xsi:type="object">Magento\Framework\Acl\Builder\Proxy</argument>
163+
</arguments>
164+
</type>
160165
<type name="Magento\Framework\Logger\Handler\Base">
161166
<arguments>
162167
<argument name="filesystem" xsi:type="object">Magento\Framework\Filesystem\Driver\File</argument>

lib/internal/Magento/Framework/Acl/Cache.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* Class Cache
1212
* @package Magento\Framework\Acl
1313
* @deprecated due to elimination of native PHP unserialization usage in 2.2.
14+
* Use data cache \Magento\Framework\Acl\Data\CacheInterface instead.
1415
*/
1516
class Cache implements CacheInterface
1617
{

lib/internal/Magento/Framework/Acl/CacheInterface.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
*
1111
* @api
1212
* @deprecated due to elimination of native PHP unserialization usage in 2.2.
13+
* Use data cache \Magento\Framework\Acl\Data\CacheInterface instead.
1314
*/
1415
interface CacheInterface
1516
{

lib/internal/Magento/Framework/Acl/Data/Cache.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ class Cache implements CacheInterface
3636
* Cache constructor.
3737
*
3838
* @param \Magento\Framework\Config\CacheInterface $cache
39-
* @param \Magento\Framework\Acl\Builder\Proxy $aclBuilder
39+
* @param \Magento\Framework\Acl\Builder $aclBuilder
4040
* @param string $cacheTag
4141
*/
4242
public function __construct(
4343
\Magento\Framework\Config\CacheInterface $cache,
44-
\Magento\Framework\Acl\Builder\Proxy $aclBuilder,
44+
\Magento\Framework\Acl\Builder $aclBuilder,
4545
$cacheTag = self::ACL_DATA_CACHE_TAG
4646
) {
4747
$this->cache = $cache;

0 commit comments

Comments
 (0)