File tree Expand file tree Collapse file tree 8 files changed +54
-4
lines changed
app/code/Magento/Customer Expand file tree Collapse file tree 8 files changed +54
-4
lines changed Original file line number Diff line number Diff line change 1010
1111/**
1212 * Class DeleteButton
13+ *
1314 * @package Magento\Customer\Block\Adminhtml\Edit
1415 */
1516class DeleteButton extends GenericButton implements ButtonProviderInterface
@@ -36,6 +37,8 @@ public function __construct(
3637 }
3738
3839 /**
40+ * Get button data.
41+ *
3942 * @return array
4043 */
4144 public function getButtonData ()
@@ -53,12 +56,15 @@ public function getButtonData()
5356 ],
5457 'on_click ' => '' ,
5558 'sort_order ' => 20 ,
59+ 'aclResource ' => 'Magento_Customer::delete ' ,
5660 ];
5761 }
5862 return $ data ;
5963 }
6064
6165 /**
66+ * Get delete url.
67+ *
6268 * @return string
6369 */
6470 public function getDeleteUrl ()
Original file line number Diff line number Diff line change 99
1010/**
1111 * Class InvalidateTokenButton
12+ *
1213 * @package Magento\Customer\Block\Adminhtml\Edit
1314 */
1415class InvalidateTokenButton extends GenericButton implements ButtonProviderInterface
1516{
1617 /**
18+ * Get button data.
19+ *
1720 * @return array
1821 */
1922 public function getButtonData ()
@@ -27,12 +30,15 @@ public function getButtonData()
2730 'class ' => 'invalidate-token ' ,
2831 'on_click ' => 'deleteConfirm(" ' . $ deleteConfirmMsg . '", " ' . $ this ->getInvalidateTokenUrl () . '") ' ,
2932 'sort_order ' => 65 ,
33+ 'aclResource ' => 'Magento_Customer::invalidate_tokens ' ,
3034 ];
3135 }
3236 return $ data ;
3337 }
3438
3539 /**
40+ * Get invalidate token url.
41+ *
3642 * @return string
3743 */
3844 public function getInvalidateTokenUrl ()
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ public function getButtonData()
2727 'class ' => 'reset reset-password ' ,
2828 'on_click ' => sprintf ("location.href = '%s'; " , $ this ->getResetPasswordUrl ()),
2929 'sort_order ' => 60 ,
30+ 'aclResource ' => 'Magento_Customer::reset_password ' ,
3031 ];
3132 }
3233 return $ data ;
Original file line number Diff line number Diff line change 77
88namespace Magento \Customer \Controller \Adminhtml \Customer ;
99
10+ use Magento \Framework \App \Action \HttpGetActionInterface ;
1011use Magento \Integration \Api \CustomerTokenServiceInterface ;
1112use Magento \Customer \Api \AccountManagementInterface ;
1213use Magento \Customer \Api \AddressRepositoryInterface ;
2526 * @SuppressWarnings(PHPMD.TooManyFields)
2627 * @SuppressWarnings(PHPMD.NumberOfChildren)
2728 */
28- class InvalidateToken extends \Magento \Customer \Controller \Adminhtml \Index
29+ class InvalidateToken extends \Magento \Customer \Controller \Adminhtml \Index implements HttpGetActionInterface
2930{
31+ /**
32+ * Authorization level of a basic admin session
33+ *
34+ * @see _isAllowed()
35+ */
36+ const ADMIN_RESOURCE = 'Magento_Customer::invalidate_tokens ' ;
37+
3038 /**
3139 * @var CustomerTokenServiceInterface
3240 */
Original file line number Diff line number Diff line change 88use Magento \Framework \App \Action \HttpPostActionInterface as HttpPostActionInterface ;
99use Magento \Framework \Controller \ResultFactory ;
1010
11+ /**
12+ * Delete customer action.
13+ */
1114class Delete extends \Magento \Customer \Controller \Adminhtml \Index implements HttpPostActionInterface
1215{
16+ /**
17+ * Authorization level of a basic admin session
18+ *
19+ * @see _isAllowed()
20+ */
21+ const ADMIN_RESOURCE = 'Magento_Customer::delete ' ;
22+
1323 /**
1424 * Delete customer action
1525 *
Original file line number Diff line number Diff line change 1818 */
1919class MassDelete extends AbstractMassAction implements HttpPostActionInterface
2020{
21+ /**
22+ * Authorization level of a basic admin session
23+ *
24+ * @see _isAllowed()
25+ */
26+ const ADMIN_RESOURCE = 'Magento_Customer::delete ' ;
27+
2128 /**
2229 * @var CustomerRepositoryInterface
2330 */
@@ -40,8 +47,7 @@ public function __construct(
4047 }
4148
4249 /**
43- * @param AbstractCollection $collection
44- * @return \Magento\Backend\Model\View\Result\Redirect
50+ * @inheritdoc
4551 */
4652 protected function massAction (AbstractCollection $ collection )
4753 {
Original file line number Diff line number Diff line change 1616 */
1717class ResetPassword extends \Magento \Customer \Controller \Adminhtml \Index implements HttpGetActionInterface
1818{
19+ /**
20+ * Authorization level of a basic admin session
21+ *
22+ * @see _isAllowed()
23+ */
24+ const ADMIN_RESOURCE = 'Magento_Customer::reset_password ' ;
25+
1926 /**
2027 * Reset password handler
2128 *
Original file line number Diff line number Diff line change 1010 <resources >
1111 <resource id =" Magento_Backend::admin" >
1212 <resource id =" Magento_Customer::customer" title =" Customers" translate =" title" sortOrder =" 40" >
13- <resource id =" Magento_Customer::manage" title =" All Customers" translate =" title" sortOrder =" 10" />
13+ <resource id =" Magento_Customer::manage" title =" All Customers" translate =" title" sortOrder =" 10" >
14+ <resource id =" Magento_Customer::actions" title =" Actions" translate =" title" sortOrder =" 10" >
15+ <resource id =" Magento_Customer::delete" title =" Delete" translate =" title" sortOrder =" 10" />
16+ <resource id =" Magento_Customer::reset_password" title =" Reset password" translate =" title" sortOrder =" 20" />
17+ <resource id =" Magento_Customer::invalidate_tokens" title =" Invalidate tokens" translate =" title" sortOrder =" 30" />
18+ </resource >
19+ </resource >
1420 <resource id =" Magento_Customer::online" title =" Now Online" translate =" title" sortOrder =" 20" />
1521 <resource id =" Magento_Customer::group" title =" Customer Groups" translate =" title" sortOrder =" 30" />
1622 </resource >
You can’t perform that action at this time.
0 commit comments