Hide order export button for all admin users except admin roleHow to remove Export option from Sales/Order grid?Hide attribute menu for admin roleHide Custom Grid Mass Action for non administrator userColumn value display wrong when export CSV in magento 2 admin UI component grid in magento 2How to add Upload Button for importing a csv file in the Custom Admin Grid Container in magento 2?UI component Export data issue : Magento 2Open a popup with form on click of link/button on customer edit form at back end Magento 2How to add new field to Admin User Info in Magento 2?Magento 2 Show custom grid on popup at admin sideSales orders not showing for new Admin user in magento2

Why did Gandalf use a sword against the Balrog?

What ability do tools use?

How to remove ambiguity: "... lives in the city of H, the capital of the province of NS, WHERE the unemployment rate is ..."?

A Non Math Puzzle. What is the middle number?

Are differences between uniformly distributed numbers uniformly distributed?

Safest way to store environment variable value in a file

How to take the beginning and end parts of a list with simpler syntax?

What is a good class if we remove subclasses?

Why did I get only 5 points even though I won?

How can God warn people of the upcoming rapture without disrupting society?

Is 悪いところを見つかった proper Japanese?

Why is the result of ('b'+'a'+ + 'a' + 'a').toLowerCase() 'banana'?

How many people would you need to pull a whale over cobblestone streets?

Boss wants me to ignore a software license

How can Radagast come across Gandalf and Thorin's company?

Can sampling rate be a floating point number?

First amendment and employment: Can a police department terminate an officer for speech?

What does the phrase "pull off sick wheelies and flips" mean here?

Graphs for which a calculus student can reasonably compute the arclength

Are employers legally allowed to pay employees in goods and services equal to or greater than the minimum wage?

How do some PhD students get 10+ papers? Is that what I need for landing good faculty position?

Markov-chain sentence generator in Python

Creating multi-attribute primary key in table in ArcGIS Desktop

Can the ground attached to neutral fool a receptacle tester?



Hide order export button for all admin users except admin role


How to remove Export option from Sales/Order grid?Hide attribute menu for admin roleHide Custom Grid Mass Action for non administrator userColumn value display wrong when export CSV in magento 2 admin UI component grid in magento 2How to add Upload Button for importing a csv file in the Custom Admin Grid Container in magento 2?UI component Export data issue : Magento 2Open a popup with form on click of link/button on customer edit form at back end Magento 2How to add new field to Admin User Info in Magento 2?Magento 2 Show custom grid on popup at admin sideSales orders not showing for new Admin user in magento2






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I want to hide or remove Export button from custom admin grid for all admin user except admin role.



I have added below code to add export button on the grid in my ui component file.



<exportButton name="export_button"/>


Can anyone suggest how can i achieve that?



Thanks in advance...!!!










share|improve this question






























    0















    I want to hide or remove Export button from custom admin grid for all admin user except admin role.



    I have added below code to add export button on the grid in my ui component file.



    <exportButton name="export_button"/>


    Can anyone suggest how can i achieve that?



    Thanks in advance...!!!










    share|improve this question


























      0












      0








      0


      1






      I want to hide or remove Export button from custom admin grid for all admin user except admin role.



      I have added below code to add export button on the grid in my ui component file.



      <exportButton name="export_button"/>


      Can anyone suggest how can i achieve that?



      Thanks in advance...!!!










      share|improve this question














      I want to hide or remove Export button from custom admin grid for all admin user except admin role.



      I have added below code to add export button on the grid in my ui component file.



      <exportButton name="export_button"/>


      Can anyone suggest how can i achieve that?



      Thanks in advance...!!!







      magento2 uicomponent user-roles grid-layout admin-user






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Aug 1 at 14:28









      Balwant SinghBalwant Singh

      4341 gold badge3 silver badges16 bronze badges




      4341 gold badge3 silver badges16 bronze badges























          1 Answer
          1






          active

          oldest

          votes


















          1














          Try the following way:



          <exportButton name="export_button" class="SROrderRefundReasonUiComponentExportButton"/>


          Now create following class:




          app/code/SR/OrderRefundReason/Ui/Component/ExportButton.php




          <?php
          namespace SROrderRefundReasonUiComponent;

          use MagentoFrameworkAuthorizationInterface;
          use MagentoFrameworkViewElementUiComponentContextInterface;
          use MagentoFrameworkUrlInterface;

          class ExportButton extends MagentoUiComponentExportButton

          /**
          * @var AuthorizationInterface
          */
          private $authorization;

          /**
          * ExportButton constructor.
          *
          * @param ContextInterface $context
          * @param UrlInterface $urlBuilder
          * @param AuthorizationInterface $authorization
          * @param array $components
          * @param array $data
          */
          public function __construct(
          ContextInterface $context,
          UrlInterface $urlBuilder,
          AuthorizationInterface $authorization,
          array $components = [],
          array $data = []
          )
          parent::__construct($context, $urlBuilder, $components, $data);
          $this->authorization = $authorization;


          /**
          * @return void
          */
          public function prepare()

          parent::prepare();
          $context = $this->getContext();
          $config = $this->getData('config');
          if (isset($config['options']))
          $options = [];
          foreach ($config['options'] as $option)
          $additionalParams = $this->getAdditionalParams($config, $context);
          $option['url'] = $this->urlBuilder->getUrl($option['url'], $additionalParams);
          $options[] = $option;

          $config['options'] = $options;

          if (!$this->authorization->isAllowed('Magento_Cms::save'))
          $config = [];


          $this->setData('config', $config);





          Modify the following line with your proper ACL permission here I am use Magento_Cms::save as an example:



          if (!$this->authorization->isAllowed('Magento_Cms::save')) 
          $config = [];






          share|improve this answer

























          • It's working for me.thanks...!!!

            – Balwant Singh
            Aug 2 at 6:38













          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "479"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f284115%2fhide-order-export-button-for-all-admin-users-except-admin-role%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          Try the following way:



          <exportButton name="export_button" class="SROrderRefundReasonUiComponentExportButton"/>


          Now create following class:




          app/code/SR/OrderRefundReason/Ui/Component/ExportButton.php




          <?php
          namespace SROrderRefundReasonUiComponent;

          use MagentoFrameworkAuthorizationInterface;
          use MagentoFrameworkViewElementUiComponentContextInterface;
          use MagentoFrameworkUrlInterface;

          class ExportButton extends MagentoUiComponentExportButton

          /**
          * @var AuthorizationInterface
          */
          private $authorization;

          /**
          * ExportButton constructor.
          *
          * @param ContextInterface $context
          * @param UrlInterface $urlBuilder
          * @param AuthorizationInterface $authorization
          * @param array $components
          * @param array $data
          */
          public function __construct(
          ContextInterface $context,
          UrlInterface $urlBuilder,
          AuthorizationInterface $authorization,
          array $components = [],
          array $data = []
          )
          parent::__construct($context, $urlBuilder, $components, $data);
          $this->authorization = $authorization;


          /**
          * @return void
          */
          public function prepare()

          parent::prepare();
          $context = $this->getContext();
          $config = $this->getData('config');
          if (isset($config['options']))
          $options = [];
          foreach ($config['options'] as $option)
          $additionalParams = $this->getAdditionalParams($config, $context);
          $option['url'] = $this->urlBuilder->getUrl($option['url'], $additionalParams);
          $options[] = $option;

          $config['options'] = $options;

          if (!$this->authorization->isAllowed('Magento_Cms::save'))
          $config = [];


          $this->setData('config', $config);





          Modify the following line with your proper ACL permission here I am use Magento_Cms::save as an example:



          if (!$this->authorization->isAllowed('Magento_Cms::save')) 
          $config = [];






          share|improve this answer

























          • It's working for me.thanks...!!!

            – Balwant Singh
            Aug 2 at 6:38















          1














          Try the following way:



          <exportButton name="export_button" class="SROrderRefundReasonUiComponentExportButton"/>


          Now create following class:




          app/code/SR/OrderRefundReason/Ui/Component/ExportButton.php




          <?php
          namespace SROrderRefundReasonUiComponent;

          use MagentoFrameworkAuthorizationInterface;
          use MagentoFrameworkViewElementUiComponentContextInterface;
          use MagentoFrameworkUrlInterface;

          class ExportButton extends MagentoUiComponentExportButton

          /**
          * @var AuthorizationInterface
          */
          private $authorization;

          /**
          * ExportButton constructor.
          *
          * @param ContextInterface $context
          * @param UrlInterface $urlBuilder
          * @param AuthorizationInterface $authorization
          * @param array $components
          * @param array $data
          */
          public function __construct(
          ContextInterface $context,
          UrlInterface $urlBuilder,
          AuthorizationInterface $authorization,
          array $components = [],
          array $data = []
          )
          parent::__construct($context, $urlBuilder, $components, $data);
          $this->authorization = $authorization;


          /**
          * @return void
          */
          public function prepare()

          parent::prepare();
          $context = $this->getContext();
          $config = $this->getData('config');
          if (isset($config['options']))
          $options = [];
          foreach ($config['options'] as $option)
          $additionalParams = $this->getAdditionalParams($config, $context);
          $option['url'] = $this->urlBuilder->getUrl($option['url'], $additionalParams);
          $options[] = $option;

          $config['options'] = $options;

          if (!$this->authorization->isAllowed('Magento_Cms::save'))
          $config = [];


          $this->setData('config', $config);





          Modify the following line with your proper ACL permission here I am use Magento_Cms::save as an example:



          if (!$this->authorization->isAllowed('Magento_Cms::save')) 
          $config = [];






          share|improve this answer

























          • It's working for me.thanks...!!!

            – Balwant Singh
            Aug 2 at 6:38













          1












          1








          1







          Try the following way:



          <exportButton name="export_button" class="SROrderRefundReasonUiComponentExportButton"/>


          Now create following class:




          app/code/SR/OrderRefundReason/Ui/Component/ExportButton.php




          <?php
          namespace SROrderRefundReasonUiComponent;

          use MagentoFrameworkAuthorizationInterface;
          use MagentoFrameworkViewElementUiComponentContextInterface;
          use MagentoFrameworkUrlInterface;

          class ExportButton extends MagentoUiComponentExportButton

          /**
          * @var AuthorizationInterface
          */
          private $authorization;

          /**
          * ExportButton constructor.
          *
          * @param ContextInterface $context
          * @param UrlInterface $urlBuilder
          * @param AuthorizationInterface $authorization
          * @param array $components
          * @param array $data
          */
          public function __construct(
          ContextInterface $context,
          UrlInterface $urlBuilder,
          AuthorizationInterface $authorization,
          array $components = [],
          array $data = []
          )
          parent::__construct($context, $urlBuilder, $components, $data);
          $this->authorization = $authorization;


          /**
          * @return void
          */
          public function prepare()

          parent::prepare();
          $context = $this->getContext();
          $config = $this->getData('config');
          if (isset($config['options']))
          $options = [];
          foreach ($config['options'] as $option)
          $additionalParams = $this->getAdditionalParams($config, $context);
          $option['url'] = $this->urlBuilder->getUrl($option['url'], $additionalParams);
          $options[] = $option;

          $config['options'] = $options;

          if (!$this->authorization->isAllowed('Magento_Cms::save'))
          $config = [];


          $this->setData('config', $config);





          Modify the following line with your proper ACL permission here I am use Magento_Cms::save as an example:



          if (!$this->authorization->isAllowed('Magento_Cms::save')) 
          $config = [];






          share|improve this answer













          Try the following way:



          <exportButton name="export_button" class="SROrderRefundReasonUiComponentExportButton"/>


          Now create following class:




          app/code/SR/OrderRefundReason/Ui/Component/ExportButton.php




          <?php
          namespace SROrderRefundReasonUiComponent;

          use MagentoFrameworkAuthorizationInterface;
          use MagentoFrameworkViewElementUiComponentContextInterface;
          use MagentoFrameworkUrlInterface;

          class ExportButton extends MagentoUiComponentExportButton

          /**
          * @var AuthorizationInterface
          */
          private $authorization;

          /**
          * ExportButton constructor.
          *
          * @param ContextInterface $context
          * @param UrlInterface $urlBuilder
          * @param AuthorizationInterface $authorization
          * @param array $components
          * @param array $data
          */
          public function __construct(
          ContextInterface $context,
          UrlInterface $urlBuilder,
          AuthorizationInterface $authorization,
          array $components = [],
          array $data = []
          )
          parent::__construct($context, $urlBuilder, $components, $data);
          $this->authorization = $authorization;


          /**
          * @return void
          */
          public function prepare()

          parent::prepare();
          $context = $this->getContext();
          $config = $this->getData('config');
          if (isset($config['options']))
          $options = [];
          foreach ($config['options'] as $option)
          $additionalParams = $this->getAdditionalParams($config, $context);
          $option['url'] = $this->urlBuilder->getUrl($option['url'], $additionalParams);
          $options[] = $option;

          $config['options'] = $options;

          if (!$this->authorization->isAllowed('Magento_Cms::save'))
          $config = [];


          $this->setData('config', $config);





          Modify the following line with your proper ACL permission here I am use Magento_Cms::save as an example:



          if (!$this->authorization->isAllowed('Magento_Cms::save')) 
          $config = [];







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Aug 1 at 15:03









          Sohel RanaSohel Rana

          25.9k3 gold badges48 silver badges66 bronze badges




          25.9k3 gold badges48 silver badges66 bronze badges















          • It's working for me.thanks...!!!

            – Balwant Singh
            Aug 2 at 6:38

















          • It's working for me.thanks...!!!

            – Balwant Singh
            Aug 2 at 6:38
















          It's working for me.thanks...!!!

          – Balwant Singh
          Aug 2 at 6:38





          It's working for me.thanks...!!!

          – Balwant Singh
          Aug 2 at 6:38

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Magento Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f284115%2fhide-order-export-button-for-all-admin-users-except-admin-role%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

          Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

          Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?