mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
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'));
|
||||
|
||||
// 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++;
|
||||
setEventMessages($langs->trans("NotEnoughPermission"), null, 'errors');
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user