File tree 2 files changed +9
-7
lines changed
app/code/Magento/MediaGalleryUi
view/adminhtml/web/js/grid/columns/image
2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 17
17
*/
18
18
class DirectoryTree extends Container
19
19
{
20
- private const ACL_DELETE_FOLDER = 'Magento_MediaGallery::delete_folder ' ;
20
+ private const ACL_IMAGE_ACTIONS = [
21
+ 'delete_folder ' => 'Magento_MediaGallery::delete_folder '
22
+ ];
21
23
22
24
/**
23
25
* @var UrlInterface
@@ -70,15 +72,17 @@ public function prepare(): void
70
72
);
71
73
}
72
74
75
+
73
76
/**
74
77
* Return allowed actions for media gallery
75
78
*/
76
79
private function getAllowedActions (): array
77
80
{
78
81
$ allowedActions = [];
79
-
80
- if ($ this ->authorization ->isAllowed (self ::ACL_DELETE_FOLDER )) {
81
- $ allowedActions [] = 'delete_folder ' ;
82
+ foreach (self ::ACL_IMAGE_ACTIONS as $ key => $ action ) {
83
+ if ($ this ->authorization ->isAllowed ($ action )) {
84
+ $ allowedActions [] = $ key ;
85
+ }
82
86
}
83
87
84
88
return $ allowedActions ;
Original file line number Diff line number Diff line change @@ -57,9 +57,7 @@ define([
57
57
58
58
if ( ! this . allowedActions . includes ( 'delete_assets' ) ) {
59
59
$ . async ( '.media-gallery-delete-assets' , function ( ) {
60
- $ ( '.media-gallery-delete-assets' ) . attr ( 'click' , '#' )
61
- . unbind ( 'click' )
62
- . addClass ( 'action-disabled' ) ;
60
+ $ ( '.media-gallery-delete-assets' ) . unbind ( 'click' ) . addClass ( 'action-disabled' ) ;
63
61
} ) ;
64
62
}
65
63
You can’t perform that action at this time.
0 commit comments