Fix permission to create a holiday when advanced permissions are set
This commit is contained in:
parent
9cb4dce485
commit
67f5837072
@ -148,7 +148,10 @@ if (empty($reshook))
|
|||||||
$description = trim(GETPOST('description', 'restricthtml'));
|
$description = trim(GETPOST('description', 'restricthtml'));
|
||||||
|
|
||||||
// Check that leave is for a user inside the hierarchy or advanced permission for all is set
|
// Check that leave is for a user inside the hierarchy or advanced permission for all is set
|
||||||
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->holiday->write)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->holiday->writeall_advance))) {
|
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->holiday->write))
|
||||||
|
|| (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->id == $fuserid && empty($user->rights->holiday->write))
|
||||||
|
|| (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->id != $fuserid && empty($user->rights->holiday->writeall_advance))
|
||||||
|
) {
|
||||||
$error++;
|
$error++;
|
||||||
setEventMessages($langs->trans("NotEnoughPermission"), null, 'errors');
|
setEventMessages($langs->trans("NotEnoughPermission"), null, 'errors');
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user