mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
fix phpstan
This commit is contained in:
parent
4bf144a80c
commit
58d581682a
|
|
@ -58,16 +58,8 @@ $extrafields->fetch_name_optionals_label($object->table_element);
|
|||
// Load object
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals
|
||||
|
||||
// There is several ways to check permission.
|
||||
// Set $enablepermissioncheck to 1 to enable a minimum low level of checks
|
||||
$enablepermissioncheck = 0;
|
||||
if ($enablepermissioncheck) {
|
||||
$permissiontoread = $user->hasRight('bookcal', 'availabilities', 'read');
|
||||
$permission = $user->hasRight('bookcal', 'availabilities', 'write');
|
||||
} else {
|
||||
$permissiontoread = 1;
|
||||
$permission = 1;
|
||||
}
|
||||
$permissiontoread = $user->hasRight('bookcal', 'availabilities', 'read');
|
||||
$permission = $user->hasRight('bookcal', 'availabilities', 'write');
|
||||
|
||||
// Security check (enable the most restrictive one)
|
||||
//if ($user->socid > 0) accessforbidden();
|
||||
|
|
|
|||
|
|
@ -85,16 +85,8 @@ if ($id > 0 || !empty($ref)) {
|
|||
$upload_dir = $conf->bookcal->multidir_output[$object->entity ? $object->entity : $conf->entity]."/availabilities/".get_exdir(0, 0, 0, 1, $object);
|
||||
}
|
||||
|
||||
// There is several ways to check permission.
|
||||
// Set $enablepermissioncheck to 1 to enable a minimum low level of checks
|
||||
$enablepermissioncheck = 0;
|
||||
if ($enablepermissioncheck) {
|
||||
$permissiontoread = $user->hasRight('bookcal', 'availabilities', 'read');
|
||||
$permissiontoadd = $user->hasRight('bookcal', 'availabilities', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php
|
||||
} else {
|
||||
$permissiontoread = 1;
|
||||
$permissiontoadd = 1;
|
||||
}
|
||||
$permissiontoread = $user->hasRight('bookcal', 'availabilities', 'read');
|
||||
$permissiontoadd = $user->hasRight('bookcal', 'availabilities', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php
|
||||
|
||||
// Security check (enable the most restrictive one)
|
||||
//if ($user->socid > 0) accessforbidden();
|
||||
|
|
|
|||
|
|
@ -60,19 +60,9 @@ if ($id > 0 || !empty($ref)) {
|
|||
$upload_dir = $conf->bookcal->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id;
|
||||
}
|
||||
|
||||
|
||||
// There is several ways to check permission.
|
||||
// Set $enablepermissioncheck to 1 to enable a minimum low level of checks
|
||||
$enablepermissioncheck = 0;
|
||||
if ($enablepermissioncheck) {
|
||||
$permissiontoread = $user->hasRight('bookcal', 'availabilities', 'read');
|
||||
$permissiontoadd = $user->hasRight('bookcal', 'availabilities', 'write');
|
||||
$permissionnote = $user->hasRight('bookcal', 'availabilities', 'write'); // Used by the include of actions_setnotes.inc.php
|
||||
} else {
|
||||
$permissiontoread = 1;
|
||||
$permissiontoadd = 1;
|
||||
$permissionnote = 1;
|
||||
}
|
||||
$permissiontoread = $user->hasRight('bookcal', 'availabilities', 'read');
|
||||
$permissiontoadd = $user->hasRight('bookcal', 'availabilities', 'write');
|
||||
$permissionnote = $user->hasRight('bookcal', 'availabilities', 'write'); // Used by the include of actions_setnotes.inc.php
|
||||
|
||||
// Security check (enable the most restrictive one)
|
||||
//if ($user->socid > 0) accessforbidden();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user