-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Bulk ACL Admin Ui #30806
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
base: 2.4-develop
Are you sure you want to change the base?
Bulk ACL Admin Ui #30806
Changes from all commits
ad4138c
1d7dea8
69badcd
46178aa
1d9d591
e5b81a4
84e619a
62cf9ac
932481e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,44 +6,36 @@ | |
namespace Magento\AsynchronousOperations\Controller\Adminhtml\Notification; | ||
|
||
use Magento\AsynchronousOperations\Model\BulkNotificationManagement; | ||
use Magento\Backend\App\Action\Context; | ||
use Magento\Backend\App\Action; | ||
use Magento\Backend\App\Action\Context; | ||
use Magento\Framework\App\Action\HttpGetActionInterface; | ||
use Magento\Framework\Controller\Result\Json; | ||
use Magento\Framework\Controller\ResultFactory; | ||
|
||
/** | ||
* Class Bulk Notification Dismiss Controller | ||
*/ | ||
class Dismiss extends Action | ||
class Dismiss extends Action implements HttpGetActionInterface | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I assume using of Abstract action is deprecated. Make sence to refactor that? Or we will leave it as it is now? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think such refactoring would be excessive for this PR. |
||
{ | ||
public const ADMIN_RESOURCE = 'Magento_AsynchronousOperations::system_magento_logging_bulk_operations'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This constant used several times, make sense to unify it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This constant is required for \Magento\Backend\App\AbstractAction::_isAllowed, so it should be defined separately for each action. |
||
|
||
/** | ||
* @var BulkNotificationManagement | ||
*/ | ||
private $notificationManagement; | ||
|
||
/** | ||
* Class constructor. | ||
* | ||
* @param Context $context | ||
* @param BulkNotificationManagement $notificationManagement | ||
*/ | ||
public function __construct( | ||
Context $context, | ||
BulkNotificationManagement $notificationManagement | ||
) { | ||
public function __construct(Context $context, BulkNotificationManagement $notificationManagement) | ||
{ | ||
parent::__construct($context); | ||
$this->notificationManagement = $notificationManagement; | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
protected function _isAllowed() | ||
{ | ||
return $this->_authorization->isAllowed('Magento_Logging::system_magento_logging_bulk_operations'); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
* @inheritdoc | ||
*/ | ||
public function execute() | ||
{ | ||
|
@@ -54,7 +46,7 @@ public function execute() | |
|
||
$isAcknowledged = $this->notificationManagement->acknowledgeBulks($bulkUuids); | ||
|
||
/** @var \Magento\Framework\Controller\Result\Json $result */ | ||
/** @var Json $result */ | ||
$result = $this->resultFactory->create(ResultFactory::TYPE_JSON); | ||
if (!$isAcknowledged) { | ||
$result->setHttpResponseCode(400); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sense to change target branch to 2.5 and get rid of Object manager?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now, this PR targeting is 2.4-develop.