// Fix "my preferences" permissions
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@12392 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -350,8 +350,6 @@ class AdminControllerCore extends Controller
|
|||||||
if ($disable)
|
if ($disable)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
$this->tabAccess = Profile::getProfileAccess($this->context->employee->id_profile, $this->id);
|
|
||||||
|
|
||||||
if ($this->tabAccess['view'] === '1')
|
if ($this->tabAccess['view'] === '1')
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -99,6 +99,13 @@ class AdminEmployeesControllerCore extends AdminController
|
|||||||
$this->themes[] = $theme;
|
$this->themes[] = $theme;
|
||||||
|
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|
||||||
|
// An employee can edit its own profile
|
||||||
|
if ($this->context->employee->id == Tools::getValue('id_employee'))
|
||||||
|
{
|
||||||
|
$this->tabAccess['view'] = '1';
|
||||||
|
$this->tabAccess['edit'] = '1';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderList()
|
public function renderList()
|
||||||
@@ -361,7 +368,7 @@ class AdminEmployeesControllerCore extends AdminController
|
|||||||
return parent::postProcess();
|
return parent::postProcess();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function initProcess()
|
/*public function initProcess()
|
||||||
{
|
{
|
||||||
// If employee is editing its own entry, its ok
|
// If employee is editing its own entry, its ok
|
||||||
if ($this->tabAccess['edit'] !== '1'
|
if ($this->tabAccess['edit'] !== '1'
|
||||||
@@ -371,6 +378,14 @@ class AdminEmployeesControllerCore extends AdminController
|
|||||||
$this->tabAccess['edit'] = 1;
|
$this->tabAccess['edit'] = 1;
|
||||||
|
|
||||||
parent::initProcess();
|
parent::initProcess();
|
||||||
|
}*/
|
||||||
|
|
||||||
|
public function initContent()
|
||||||
|
{
|
||||||
|
if ($this->context->employee->id == Tools::getValue('id_employee'))
|
||||||
|
$this->display = 'edit';
|
||||||
|
|
||||||
|
return parent::initContent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user