Skip to content

Introduced granulated Media Gallery ACL resources #29715

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 30 commits into from
Sep 11, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
771dc31
Introduce granulated Media Gallery ACL resources and enforce for old…
Nazar65 Aug 21, 2020
dd9bdda
Improve acl resources for new media gallery
Nazar65 Aug 28, 2020
989139f
Improve button visibility
Nazar65 Aug 28, 2020
239314d
Improve button visibility per allowed actions for user
Nazar65 Aug 28, 2020
eaa20f2
Merge branch '2.4-develop' of https://github.com/magento/magento2 int…
Nazar65 Aug 28, 2020
8cdcefd
Improve buttons visibility per user permission
Nazar65 Aug 28, 2020
43fd057
Code style improvements
Nazar65 Aug 28, 2020
dfa67b0
Static test fixes
Nazar65 Aug 28, 2020
8ef07f4
fix css static tests
Nazar65 Aug 28, 2020
3af8416
Fix composer json
Nazar65 Aug 29, 2020
7940f59
cover changes with mftf tests
Nazar65 Aug 30, 2020
e690a8d
Refactor mftf tests
Nazar65 Aug 31, 2020
4c085d7
Fix flaky mftf test
Nazar65 Aug 31, 2020
0e28c91
fix actiongroup to clear filters
Nazar65 Aug 31, 2020
80dae45
Fix flaky mftf tests
Nazar65 Aug 31, 2020
67636e7
magento/magento2#29715: Moved ACL to MediaGalleryApi
sivaschenko Sep 2, 2020
739e6dc
magento/magento2#29715: Moved ACL to MediaGalleryUiApi
sivaschenko Sep 3, 2020
68bc010
magento/magento2#29715: Enforced ACL for context menu and view details
sivaschenko Sep 3, 2020
0ad0630
magento/magento2#29715: Corrected ACL resource names
sivaschenko Sep 3, 2020
9ccfdc9
magento/magento2#29715: Added data upgrade script
sivaschenko Sep 3, 2020
7b58d97
Merge branch '2.4-develop' into ASI-1487
sivaschenko Sep 3, 2020
90c9dac
magento/magento2#29715: Corrected actions order
sivaschenko Sep 4, 2020
88a0150
Merge branch '2.4-develop' into ASI-1487
sivaschenko Sep 4, 2020
748eb4f
magento/magento2#29715: Corrected dependencies
sivaschenko Sep 4, 2020
b3d5255
magento/magento2#29715: Corrected standalone actions and upgrade script
sivaschenko Sep 4, 2020
0a6156f
magento/magento2#29715: Fixed upgrade
sivaschenko Sep 4, 2020
253bafb
magento/magento2#29715: Fixed tests
sivaschenko Sep 4, 2020
2448fd8
Merge branch '2.4-develop' into ASI-1487
sivaschenko Sep 4, 2020
cf288e6
Merge branch '2.4-develop' of github.com:magento/magento2 into ASI-1487
sivaschenko Sep 7, 2020
7296cdf
magento/magento2#29715: Removed redundant dependency
sivaschenko Sep 7, 2020
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 @@ -13,6 +13,11 @@
*/
class DeleteFiles extends \Magento\Cms\Controller\Adminhtml\Wysiwyg\Images implements HttpPostActionInterface
{
/**
* @see _isAllowed()
*/
public const ADMIN_RESOURCE = 'Magento_Cms::delete_assets';

/**
* @var \Magento\Framework\Controller\Result\JsonFactory
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
*/
class DeleteFolder extends \Magento\Cms\Controller\Adminhtml\Wysiwyg\Images implements HttpPostActionInterface
{
/**
* @see _isAllowed()
*/
public const ADMIN_RESOURCE = 'Magento_Cms::delete_folder';

/**
* @var \Magento\Framework\Controller\Result\JsonFactory
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
*/
class NewFolder extends \Magento\Cms\Controller\Adminhtml\Wysiwyg\Images implements HttpPostActionInterface
{
/**
* @see _isAllowed()
*/
public const ADMIN_RESOURCE = 'Magento_Cms::create_folder';

/**
* @var \Magento\Framework\Controller\Result\JsonFactory
*/
Expand Down Expand Up @@ -65,7 +70,7 @@ public function execute()
}
/** @var \Magento\Framework\Controller\Result\Json $resultJson */
$resultJson = $this->resultJsonFactory->create();

return $resultJson->setData($result);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@

class OnInsert extends \Magento\Cms\Controller\Adminhtml\Wysiwyg\Images
{
/**
* @see _isAllowed()
*/
public const ADMIN_RESOURCE = 'Magento_Cms::insert_assets';

/**
* @var \Magento\Framework\Controller\Result\RawFactory
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
*/
class Upload extends \Magento\Cms\Controller\Adminhtml\Wysiwyg\Images implements HttpPostActionInterface
{
/**
* @see _isAllowed()
*/
public const ADMIN_RESOURCE = 'Magento_Cms::upload_assets';

/**
* @var \Magento\Framework\Controller\Result\JsonFactory
*/
Expand Down Expand Up @@ -74,7 +79,7 @@ public function execute()
}
/** @var \Magento\Framework\Controller\Result\Json $resultJson */
$resultJson = $this->resultJsonFactory->create();

return $resultJson->setData($response);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Create extends Action implements HttpPostActionInterface
/**
* @see _isAllowed()
*/
public const ADMIN_RESOURCE = 'Magento_Cms::media_gallery';
public const ADMIN_RESOURCE = 'Magento_Cms::create_folder';

/**
* @var CreateDirectoriesByPathsInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Delete extends Action implements HttpPostActionInterface
/**
* @see _isAllowed()
*/
public const ADMIN_RESOURCE = 'Magento_Cms::media_gallery';
public const ADMIN_RESOURCE = 'Magento_Cms::delete_folder';

/**
* @var DeleteAssetsByPathsInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Delete extends Action implements HttpPostActionInterface
/**
* @see _isAllowed()
*/
public const ADMIN_RESOURCE = 'Magento_Cms::media_gallery';
public const ADMIN_RESOURCE = 'Magento_Cms::delete_assets';

/**
* @var DeleteImage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Upload extends Action implements HttpPostActionInterface
/**
* @see _isAllowed()
*/
public const ADMIN_RESOURCE = 'Magento_Cms::media_gallery';
public const ADMIN_RESOURCE = 'Magento_Cms::upload_assets';

/**
* @var UploadImage
Expand Down
26 changes: 26 additions & 0 deletions app/code/Magento/MediaGalleryUi/etc/acl.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
<acl>
<resources>
<resource id="Magento_Backend::admin">
<resource id="Magento_Backend::content">
<resource id="Magento_Backend::content_elements">
<resource id="Magento_Cms::media_gallery">
<resource id="Magento_Cms::upload_assets" title="Upload Assets" translate="title" sortOrder="70"/>
<resource id="Magento_Cms::delete_assets" title="Delete Assets" translate="title" sortOrder="60"/>
<resource id="Magento_Cms::insert_assets" title="Insert Assets into the content" translate="title" sortOrder="50"/>
<resource id="Magento_Cms::create_folder" title="Create Folder" translate="title" sortOrder="40"/>
<resource id="Magento_Cms::delete_folder" title="Delete Folder" translate="title" sortOrder="40"/>
</resource>
</resource>
</resource>
</resource>
</resources>
</acl>
</config>