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 10
10
11
11
/**
12
12
* Class DeleteButton
13
+ *
13
14
* @package Magento\Customer\Block\Adminhtml\Edit
14
15
*/
15
16
class DeleteButton extends GenericButton implements ButtonProviderInterface
@@ -36,6 +37,8 @@ public function __construct(
36
37
}
37
38
38
39
/**
40
+ * Get button data.
41
+ *
39
42
* @return array
40
43
*/
41
44
public function getButtonData ()
@@ -53,12 +56,15 @@ public function getButtonData()
53
56
],
54
57
'on_click ' => '' ,
55
58
'sort_order ' => 20 ,
59
+ 'aclResource ' => 'Magento_Customer::delete ' ,
56
60
];
57
61
}
58
62
return $ data ;
59
63
}
60
64
61
65
/**
66
+ * Get delete url.
67
+ *
62
68
* @return string
63
69
*/
64
70
public function getDeleteUrl ()
Original file line number Diff line number Diff line change 9
9
10
10
/**
11
11
* Class InvalidateTokenButton
12
+ *
12
13
* @package Magento\Customer\Block\Adminhtml\Edit
13
14
*/
14
15
class InvalidateTokenButton extends GenericButton implements ButtonProviderInterface
15
16
{
16
17
/**
18
+ * Get button data.
19
+ *
17
20
* @return array
18
21
*/
19
22
public function getButtonData ()
@@ -27,12 +30,15 @@ public function getButtonData()
27
30
'class ' => 'invalidate-token ' ,
28
31
'on_click ' => 'deleteConfirm(" ' . $ deleteConfirmMsg . '", " ' . $ this ->getInvalidateTokenUrl () . '") ' ,
29
32
'sort_order ' => 65 ,
33
+ 'aclResource ' => 'Magento_Customer::invalidate_tokens ' ,
30
34
];
31
35
}
32
36
return $ data ;
33
37
}
34
38
35
39
/**
40
+ * Get invalidate token url.
41
+ *
36
42
* @return string
37
43
*/
38
44
public function getInvalidateTokenUrl ()
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ public function getButtonData()
27
27
'class ' => 'reset reset-password ' ,
28
28
'on_click ' => sprintf ("location.href = '%s'; " , $ this ->getResetPasswordUrl ()),
29
29
'sort_order ' => 60 ,
30
+ 'aclResource ' => 'Magento_Customer::reset_password ' ,
30
31
];
31
32
}
32
33
return $ data ;
Original file line number Diff line number Diff line change 7
7
8
8
namespace Magento \Customer \Controller \Adminhtml \Customer ;
9
9
10
+ use Magento \Framework \App \Action \HttpGetActionInterface ;
10
11
use Magento \Integration \Api \CustomerTokenServiceInterface ;
11
12
use Magento \Customer \Api \AccountManagementInterface ;
12
13
use Magento \Customer \Api \AddressRepositoryInterface ;
25
26
* @SuppressWarnings(PHPMD.TooManyFields)
26
27
* @SuppressWarnings(PHPMD.NumberOfChildren)
27
28
*/
28
- class InvalidateToken extends \Magento \Customer \Controller \Adminhtml \Index
29
+ class InvalidateToken extends \Magento \Customer \Controller \Adminhtml \Index implements HttpGetActionInterface
29
30
{
31
+ /**
32
+ * Authorization level of a basic admin session
33
+ *
34
+ * @see _isAllowed()
35
+ */
36
+ const ADMIN_RESOURCE = 'Magento_Customer::invalidate_tokens ' ;
37
+
30
38
/**
31
39
* @var CustomerTokenServiceInterface
32
40
*/
Original file line number Diff line number Diff line change 8
8
use Magento \Framework \App \Action \HttpPostActionInterface as HttpPostActionInterface ;
9
9
use Magento \Framework \Controller \ResultFactory ;
10
10
11
+ /**
12
+ * Delete customer action.
13
+ */
11
14
class Delete extends \Magento \Customer \Controller \Adminhtml \Index implements HttpPostActionInterface
12
15
{
16
+ /**
17
+ * Authorization level of a basic admin session
18
+ *
19
+ * @see _isAllowed()
20
+ */
21
+ const ADMIN_RESOURCE = 'Magento_Customer::delete ' ;
22
+
13
23
/**
14
24
* Delete customer action
15
25
*
Original file line number Diff line number Diff line change 18
18
*/
19
19
class MassDelete extends AbstractMassAction implements HttpPostActionInterface
20
20
{
21
+ /**
22
+ * Authorization level of a basic admin session
23
+ *
24
+ * @see _isAllowed()
25
+ */
26
+ const ADMIN_RESOURCE = 'Magento_Customer::delete ' ;
27
+
21
28
/**
22
29
* @var CustomerRepositoryInterface
23
30
*/
@@ -40,8 +47,7 @@ public function __construct(
40
47
}
41
48
42
49
/**
43
- * @param AbstractCollection $collection
44
- * @return \Magento\Backend\Model\View\Result\Redirect
50
+ * @inheritdoc
45
51
*/
46
52
protected function massAction (AbstractCollection $ collection )
47
53
{
Original file line number Diff line number Diff line change 16
16
*/
17
17
class ResetPassword extends \Magento \Customer \Controller \Adminhtml \Index implements HttpGetActionInterface
18
18
{
19
+ /**
20
+ * Authorization level of a basic admin session
21
+ *
22
+ * @see _isAllowed()
23
+ */
24
+ const ADMIN_RESOURCE = 'Magento_Customer::reset_password ' ;
25
+
19
26
/**
20
27
* Reset password handler
21
28
*
Original file line number Diff line number Diff line change 10
10
<resources >
11
11
<resource id =" Magento_Backend::admin" >
12
12
<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 >
14
20
<resource id =" Magento_Customer::online" title =" Now Online" translate =" title" sortOrder =" 20" />
15
21
<resource id =" Magento_Customer::group" title =" Customer Groups" translate =" title" sortOrder =" 30" />
16
22
</resource >
You can’t perform that action at this time.
0 commit comments