-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MAGETWO-70277: Merge branch 'develop' of github.com:magento/magento2c…
…e into MAGETWO-70277-PR-10062
- Loading branch information
Showing
7 changed files
with
111 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> | ||
<acl> | ||
<resources> | ||
<resource id="Magento_Backend::admin"> | ||
<resource id="Magento_Backend::stores"> | ||
<resource id="Magento_Backend::stores_attributes"> | ||
<resource id="Magento_Swatches::iframe" title="Swatches" translate="title" sortOrder="70" /> | ||
</resource> | ||
</resource> | ||
</resource> | ||
</resources> | ||
</acl> | ||
</config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
dev/tests/integration/testsuite/Magento/Swatches/Controller/Adminhtml/Iframe/ShowTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Swatches\Controller\Adminhtml\Iframe; | ||
|
||
/** | ||
* @magentoAppArea adminhtml | ||
*/ | ||
class ShowTest extends \Magento\TestFramework\TestCase\AbstractBackendController | ||
{ | ||
/** | ||
* Check Swatch Acl Access | ||
*/ | ||
public function testAclAccess() | ||
{ | ||
/** @var $acl \Magento\Framework\Acl */ | ||
$acl = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() | ||
->get(\Magento\Framework\Acl\Builder::class) | ||
->getAcl(); | ||
|
||
$acl->allow(null, \Magento\Swatches\Controller\Adminhtml\Iframe\Show::ADMIN_RESOURCE); | ||
|
||
$this->dispatch('backend/swatches/iframe/show/'); | ||
|
||
$this->assertEquals(200, $this->getResponse()->getHttpResponseCode()); | ||
$this->assertNotContains('Access denied', $this->getResponse()->getBody()); | ||
} | ||
|
||
/** | ||
* Check Swatch Acl Access Denied | ||
*/ | ||
public function testAclAccessDenied() | ||
{ | ||
/** @var $acl \Magento\Framework\Acl */ | ||
$acl = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() | ||
->get(\Magento\Framework\Acl\Builder::class) | ||
->getAcl(); | ||
|
||
$acl->deny(null, \Magento\Swatches\Controller\Adminhtml\Iframe\Show::ADMIN_RESOURCE); | ||
|
||
$this->dispatch('backend/swatches/iframe/show/'); | ||
|
||
$this->assertEquals(403, $this->getResponse()->getHttpResponseCode()); | ||
$this->assertContains('Access denied', $this->getResponse()->getBody()); | ||
} | ||
} |