Skip to content

Commit fa38ed7

Browse files
author
Yaroslav Onischenko
committed
MAGETWO-57805: [mainline] It is possible to delete self admin account or role
1 parent 004b0b2 commit fa38ed7

File tree

1 file changed

+2
-2
lines changed
  • app/code/Magento/User/Controller/Adminhtml/User

1 file changed

+2
-2
lines changed

app/code/Magento/User/Controller/Adminhtml/User/Delete.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ class Delete extends \Magento\User\Controller\Adminhtml\User
1414
public function execute()
1515
{
1616
$currentUser = $this->_objectManager->get(\Magento\Backend\Model\Auth\Session::class)->getUser();
17-
18-
if ($userId = (int)$this->getRequest()->getPost('user_id')) {
17+
$userId = (int)$this->getRequest()->getPost('user_id');
18+
if ($userId) {
1919
if ($currentUser->getId() == $userId) {
2020
$this->messageManager->addError(__('You cannot delete your own account.'));
2121
$this->_redirect('adminhtml/*/edit', ['user_id' => $userId]);

0 commit comments

Comments
 (0)