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;
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
add a comment |
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
add a comment |
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
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
magento2 uicomponent user-roles grid-layout admin-user
asked Aug 1 at 14:28
Balwant SinghBalwant Singh
4341 gold badge3 silver badges16 bronze badges
4341 gold badge3 silver badges16 bronze badges
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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 = [];
It's working for me.thanks...!!!
– Balwant Singh
Aug 2 at 6:38
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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 = [];
It's working for me.thanks...!!!
– Balwant Singh
Aug 2 at 6:38
add a comment |
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 = [];
It's working for me.thanks...!!!
– Balwant Singh
Aug 2 at 6:38
add a comment |
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 = [];
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 = [];
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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