Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

/**
* Class DeleteButton
*
* @package Magento\Customer\Block\Adminhtml\Edit
*/
class DeleteButton extends GenericButton implements ButtonProviderInterface
Expand All @@ -36,6 +37,8 @@ public function __construct(
}

/**
* Get button data.
*
* @return array
*/
public function getButtonData()
Expand All @@ -53,12 +56,15 @@ public function getButtonData()
],
'on_click' => '',
'sort_order' => 20,
'aclResource' => 'Magento_Customer::delete',
];
}
return $data;
}

/**
* Get delete url.
*
* @return string
*/
public function getDeleteUrl()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@

/**
* Class InvalidateTokenButton
*
* @package Magento\Customer\Block\Adminhtml\Edit
*/
class InvalidateTokenButton extends GenericButton implements ButtonProviderInterface
{
/**
* Get button data.
*
* @return array
*/
public function getButtonData()
Expand All @@ -27,12 +30,15 @@ public function getButtonData()
'class' => 'invalidate-token',
'on_click' => 'deleteConfirm("' . $deleteConfirmMsg . '", "' . $this->getInvalidateTokenUrl() . '")',
'sort_order' => 65,
'aclResource' => 'Magento_Customer::invalidate_tokens',
];
}
return $data;
}

/**
* Get invalidate token url.
*
* @return string
*/
public function getInvalidateTokenUrl()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public function getButtonData()
'class' => 'reset reset-password',
'on_click' => sprintf("location.href = '%s';", $this->getResetPasswordUrl()),
'sort_order' => 60,
'aclResource' => 'Magento_Customer::reset_password',
];
}
return $data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

namespace Magento\Customer\Controller\Adminhtml\Customer;

use Magento\Framework\App\Action\HttpGetActionInterface;
use Magento\Integration\Api\CustomerTokenServiceInterface;
use Magento\Customer\Api\AccountManagementInterface;
use Magento\Customer\Api\AddressRepositoryInterface;
Expand All @@ -25,8 +26,15 @@
* @SuppressWarnings(PHPMD.TooManyFields)
* @SuppressWarnings(PHPMD.NumberOfChildren)
*/
class InvalidateToken extends \Magento\Customer\Controller\Adminhtml\Index
class InvalidateToken extends \Magento\Customer\Controller\Adminhtml\Index implements HttpGetActionInterface
{
/**
* Authorization level of a basic admin session
*
* @see _isAllowed()
*/
const ADMIN_RESOURCE = 'Magento_Customer::invalidate_tokens';

/**
* @var CustomerTokenServiceInterface
*/
Expand Down
10 changes: 10 additions & 0 deletions app/code/Magento/Customer/Controller/Adminhtml/Index/Delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,18 @@
use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface;
use Magento\Framework\Controller\ResultFactory;

/**
* Delete customer action.
*/
class Delete extends \Magento\Customer\Controller\Adminhtml\Index implements HttpPostActionInterface
{
/**
* Authorization level of a basic admin session
*
* @see _isAllowed()
*/
const ADMIN_RESOURCE = 'Magento_Customer::delete';

/**
* Delete customer action
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@
*/
class MassDelete extends AbstractMassAction implements HttpPostActionInterface
{
/**
* Authorization level of a basic admin session
*
* @see _isAllowed()
*/
const ADMIN_RESOURCE = 'Magento_Customer::delete';

/**
* @var CustomerRepositoryInterface
*/
Expand All @@ -40,8 +47,7 @@ public function __construct(
}

/**
* @param AbstractCollection $collection
* @return \Magento\Backend\Model\View\Result\Redirect
* @inheritdoc
*/
protected function massAction(AbstractCollection $collection)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@
*/
class ResetPassword extends \Magento\Customer\Controller\Adminhtml\Index implements HttpGetActionInterface
{
/**
* Authorization level of a basic admin session
*
* @see _isAllowed()
*/
const ADMIN_RESOURCE = 'Magento_Customer::reset_password';

/**
* Reset password handler
*
Expand Down
8 changes: 7 additions & 1 deletion app/code/Magento/Customer/etc/acl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@
<resources>
<resource id="Magento_Backend::admin">
<resource id="Magento_Customer::customer" title="Customers" translate="title" sortOrder="40">
<resource id="Magento_Customer::manage" title="All Customers" translate="title" sortOrder="10" />
<resource id="Magento_Customer::manage" title="All Customers" translate="title" sortOrder="10">
<resource id="Magento_Customer::actions" title="Actions" translate="title" sortOrder="10">
<resource id="Magento_Customer::delete" title="Delete" translate="title" sortOrder="10" />
<resource id="Magento_Customer::reset_password" title="Reset password" translate="title" sortOrder="20" />
<resource id="Magento_Customer::invalidate_tokens" title="Invalidate tokens" translate="title" sortOrder="30" />
</resource>
</resource>
<resource id="Magento_Customer::online" title="Now Online" translate="title" sortOrder="20" />
<resource id="Magento_Customer::group" title="Customer Groups" translate="title" sortOrder="30" />
</resource>
Expand Down