[-] BO: Admin Home do not display quick links when access is denied for employee

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16749 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rGaillard
2012-08-07 13:49:20 +00:00
parent c5a07b8c1a
commit 019be0aeff
2 changed files with 71 additions and 66 deletions
+16 -22
View File
@@ -81,10 +81,6 @@ class AdminWarehousesControllerCore extends AdminController
*/
public function renderList()
{
// Checks access
if (!($this->tabAccess['add'] === '1'))
unset($this->toolbar_btn['new']);
// removes links on rows
$this->list_no_link = true;
@@ -474,17 +470,25 @@ class AdminWarehousesControllerCore extends AdminController
}
}
}
/**
* Checks access of the employee
*/
public function processCheckAccess()
public function initContent()
{
if (Tools::isSubmit('submitAdd'.$this->table) && !($this->tabAccess['add'] === '1'))
if (!Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT'))
{
$this->errors[] = Tools::displayError('You do not have the required permissions to add warehouses.');
return parent::postProcess();
$this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management prior to use this feature.');
return false;
}
parent::initContent();
}
public function initProcess()
{
if (!Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT'))
{
$this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management prior to use this feature.');
return false;
}
parent::initProcess();
}
/**
@@ -595,15 +599,5 @@ class AdminWarehousesControllerCore extends AdminController
return;
$obj->resetStockAvailable();
}
/**
* @see AdminController::initProcess()
*/
public function initProcess()
{
// checks access
$this->processCheckAccess();
return parent::initprocess();
}
}