Details.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\AsynchronousOperations\Controller\Adminhtml\Bulk;
  7. /**
  8. * Class View Operation Details Controller
  9. */
  10. class Details extends \Magento\Backend\App\Action implements \Magento\Framework\App\Action\HttpGetActionInterface
  11. {
  12. /**
  13. * @var \Magento\Framework\View\Result\PageFactory
  14. */
  15. private $resultPageFactory;
  16. /**
  17. * @var \Magento\AsynchronousOperations\Model\AccessValidator
  18. */
  19. private $accessValidator;
  20. /**
  21. * @var string
  22. */
  23. private $menuId;
  24. /**
  25. * Details constructor.
  26. * @param \Magento\Backend\App\Action\Context $context
  27. * @param \Magento\Framework\View\Result\PageFactory $resultPageFactory
  28. * @param \Magento\AsynchronousOperations\Model\AccessValidator $accessValidator
  29. * @param string $menuId
  30. */
  31. public function __construct(
  32. \Magento\Backend\App\Action\Context $context,
  33. \Magento\Framework\View\Result\PageFactory $resultPageFactory,
  34. \Magento\AsynchronousOperations\Model\AccessValidator $accessValidator,
  35. $menuId = 'Magento_AsynchronousOperations::system_magento_logging_bulk_operations'
  36. ) {
  37. $this->resultPageFactory = $resultPageFactory;
  38. $this->accessValidator = $accessValidator;
  39. $this->menuId = $menuId;
  40. parent::__construct($context);
  41. }
  42. /**
  43. * @inheritDoc
  44. */
  45. protected function _isAllowed()
  46. {
  47. return $this->_authorization->isAllowed('Magento_Logging::system_magento_logging_bulk_operations')
  48. && $this->accessValidator->isAllowed($this->getRequest()->getParam('uuid'));
  49. }
  50. /**
  51. * Bulk details action
  52. *
  53. * @return \Magento\Framework\View\Result\Page
  54. */
  55. public function execute()
  56. {
  57. $bulkId = $this->getRequest()->getParam('uuid');
  58. $resultPage = $this->resultPageFactory->create();
  59. $resultPage->initLayout();
  60. $this->_setActiveMenu($this->menuId);
  61. $resultPage->getConfig()->getTitle()->prepend(__('Action Details - #' . $bulkId));
  62. return $resultPage;
  63. }
  64. }