Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 7ea91aa

Browse files
author
Joan He
committed
Merge branch 'MAGETWO-83183-update-access-denied' into MAGETWO-83013-ReleaseNotification
2 parents f6b86d3 + b0a9c5e commit 7ea91aa

File tree

6 files changed

+58
-13
lines changed

6 files changed

+58
-13
lines changed

app/code/Magento/Backend/view/adminhtml/templates/admin/access_denied.phtml

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,22 @@
1212
* @see \Magento\Backend\Block\Denied
1313
*/
1414
?>
15-
<h1 class="page-heading"><?= /* @escapeNotVerified */ __('Access denied') ?></h1>
16-
<?php if (!$block->hasAvailableResources()): ?>
17-
<p>
18-
<?= /* @escapeNotVerified */ __('Please try to sign out and sign in again.') ?><br/>
19-
<?= /* @escapeNotVerified */ __('If you continue to receive this message, please contact the store owner.') ?>
20-
</p>
21-
<?php else: ?>
22-
<p><?= /* @escapeNotVerified */ __('You need more permissions to access this.') ?></p>
23-
<?php endif?>
15+
<hr class="access-denied-hr"/>
16+
<div class="access-denied-page">
17+
<h2 class="page-heading"><?= $block->escapeHtml(__('Sorry, you need permissions to view this content.')) ?></h2>
18+
<?php if (!$block->hasAvailableResources()): ?>
19+
<strong><?= $block->escapeHtml(__('Next steps')) ?></strong>
20+
<ul>
21+
<li><span><?= $block->escapeHtml(__('If you think this is an error, try signing out and signing in again.')) ?></span></li>
22+
<li><span><?= $block->escapeHtml(__('Contact a system administrator or store owner to gain permissions.')) ?></span></li>
23+
<li>
24+
<span><?= $block->escapeHtml(__('Return to ')) ?>
25+
<a href="<?= $block->escapeHtmlAttr(__('javascript:history.back()')) ?>">
26+
<?= $block->escapeHtml(__('previous page')) ?></a><?= $block->escapeHtml(__('.')) ?>
27+
</span>
28+
</li>
29+
</ul>
30+
<?php else: ?>
31+
<p><?= $block->escapeHtml(__('Access denied.')) ?></p>
32+
<?php endif?>
33+
</div>

app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/_module.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@
1919
@import 'module/pages/_dashboard.less';
2020
@import 'module/pages/_login.less';
2121
@import 'module/pages/_cache-management.less';
22+
@import 'module/pages/_access-denied.less';
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// /**
2+
// * Copyright © Magento, Inc. All rights reserved.
3+
// * See COPYING.txt for license details.
4+
// */
5+
6+
//
7+
// Access Error Page
8+
// ---------------------------------------------
9+
10+
.access-denied-hr {
11+
height: 0.2rem;
12+
border: 0;
13+
box-shadow: 0 10px 10px -10px #b4b3b3 inset;
14+
}
15+
16+
.access-denied-page {
17+
margin: 3.5rem 0 10rem 0;
18+
19+
h2 {
20+
margin-bottom: 3rem;
21+
}
22+
23+
ul {
24+
li {
25+
font-size: @font-size__s;
26+
margin: 2rem 0 2rem 3rem;
27+
28+
span {
29+
font-size: @font-size__base;
30+
margin-left: 1rem;
31+
}
32+
}
33+
}
34+
}

dev/tests/functional/tests/app/Magento/Search/Test/Constraint/AssertSynonymRestrictedAccess.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class AssertSynonymRestrictedAccess extends AbstractConstraint
1818
/**
1919
* Access denied text.
2020
*/
21-
const ACCESS_DENIED_TEXT = 'Access denied';
21+
const ACCESS_DENIED_TEXT = 'Sorry, you need permissions to view this content.';
2222

2323
/**
2424
* Assert that access to synonym group index page is restricted.

dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserRoleRestrictedAccess.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717
class AssertUserRoleRestrictedAccess extends AbstractConstraint
1818
{
19-
const DENIED_ACCESS = 'Access denied';
19+
const DENIED_ACCESS = 'Sorry, you need permissions to view this content.';
2020

2121
/**
2222
* Asserts that user has only related permissions.

dev/tests/integration/testsuite/Magento/Swatches/Controller/Adminhtml/Iframe/ShowTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function testAclAccess()
2525
$this->dispatch('backend/swatches/iframe/show/');
2626

2727
$this->assertEquals(200, $this->getResponse()->getHttpResponseCode());
28-
$this->assertNotContains('Access denied', $this->getResponse()->getBody());
28+
$this->assertNotContains('Sorry, you need permissions to view this content.', $this->getResponse()->getBody());
2929
}
3030

3131
/**
@@ -43,6 +43,6 @@ public function testAclAccessDenied()
4343
$this->dispatch('backend/swatches/iframe/show/');
4444

4545
$this->assertEquals(403, $this->getResponse()->getHttpResponseCode());
46-
$this->assertContains('Access denied', $this->getResponse()->getBody());
46+
$this->assertContains('Sorry, you need permissions to view this content.', $this->getResponse()->getBody());
4747
}
4848
}

0 commit comments

Comments
 (0)