protected function _isAllowed()
 {
     $result = Praxigento_LoginAs_Config::canAccessLoginAs();
     return $result;
 }
예제 #2
0
 /**
  * Add new action to customers grid.
  * @param Mage_Adminhtml_Block_Customer_Grid $block
  */
 private function doCustomerGridActionAdd(Mage_Adminhtml_Block_Customer_Grid $block)
 {
     /** validate availability & permissions */
     if (Praxigento_LoginAs_Config::cfgUiCustomersGridActionEnabled() && Praxigento_LoginAs_Config::canAccessLoginAs()) {
         /** add action link to grid */
         /** @var $cols  array */
         $cols = $block->getColumns();
         /** @var $colAction Mage_Adminhtml_Block_Widget_Grid_Column */
         $colAction = $cols['action'];
         $actions = $colAction->getData('actions');
         if (is_array($actions)) {
             /** add new action */
             $actions[] = array('caption' => Praxigento_LoginAs_Config::helper()->__('Login as...'), 'url' => array('base' => Praxigento_LoginAs_Config::XMLCFG_ROUTER_ADMIN . Praxigento_LoginAs_Config::ROUTE_REDIRECT), 'field' => Praxigento_LoginAs_Config::REQ_PARAM_LAS_ID, 'target' => '_blank');
             $colAction->setData('actions', $actions);
             /** reset default renderer */
             $colAction->setData('renderer', 'adminhtml/customer_grid_renderer_multiaction');
         }
     }
 }