// Fix "my preferences" permissions

This commit is contained in:
tDidierjean
2012-01-12 14:47:03 +00:00
parent 50b65b41fd
commit ed6c16aef8
2 changed files with 16 additions and 3 deletions
-2
View File
@@ -350,8 +350,6 @@ class AdminControllerCore extends Controller
if ($disable)
return true;
$this->tabAccess = Profile::getProfileAccess($this->context->employee->id_profile, $this->id);
if ($this->tabAccess['view'] === '1')
return true;
return false;
+16 -1
View File
@@ -99,6 +99,13 @@ class AdminEmployeesControllerCore extends AdminController
$this->themes[] = $theme;
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()
@@ -361,7 +368,7 @@ class AdminEmployeesControllerCore extends AdminController
return parent::postProcess();
}
public function initProcess()
/*public function initProcess()
{
// If employee is editing its own entry, its ok
if ($this->tabAccess['edit'] !== '1'
@@ -371,6 +378,14 @@ class AdminEmployeesControllerCore extends AdminController
$this->tabAccess['edit'] = 1;
parent::initProcess();
}*/
public function initContent()
{
if ($this->context->employee->id == Tools::getValue('id_employee'))
$this->display = 'edit';
return parent::initContent();
}
}