fix: read employee and write employee

This commit is contained in:
steve 2022-02-28 16:48:08 +01:00
parent 08fa2dfadd
commit 91ee90ebeb
2 changed files with 3 additions and 3 deletions

View File

@ -141,7 +141,7 @@ function user_prepare_head($object)
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf, $langs, $object, $head, $h, 'user');
if ((!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read))
if ((!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read) && !empty($user->rights->hrm->read_employee->read))
|| (!empty($conf->hrm->enabled) && !empty($user->rights->hrm->employee->read))
|| (!empty($conf->expensereport->enabled) && !empty($user->rights->expensereport->lire) && ($user->id == $object->id || $user->rights->expensereport->readall))
|| (!empty($conf->holiday->enabled) && !empty($user->rights->holiday->read) && ($user->id == $object->id || $user->rights->holiday->readall))

View File

@ -255,7 +255,7 @@ class modHRM extends DolibarrModules
$this->rights[$r][1] = 'Read employee'; // Permission label
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
$this->rights[$r][4] = 'read_employee';
$this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->hrm->compare_advance->read)
$this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->hrm->read_employee->read)
$r++;
// Write employee
@ -263,7 +263,7 @@ class modHRM extends DolibarrModules
$this->rights[$r][1] = 'Write employee'; // Permission label
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
$this->rights[$r][4] = 'write_employee';
$this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->hrm->compare_advance->read)
$this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->hrm->write_employee->write)
$r++;
}