update code toward php8 compliance
This commit is contained in:
parent
99e0b5e945
commit
857646ed36
@ -480,7 +480,7 @@ if (empty($reshook)) {
|
|||||||
// Mass actions
|
// Mass actions
|
||||||
$objectclass = 'Bookkeeping';
|
$objectclass = 'Bookkeeping';
|
||||||
$objectlabel = 'Bookkeeping';
|
$objectlabel = 'Bookkeeping';
|
||||||
$permissiontoread = $user->rights->societe->lire;
|
$permissiontoread = $user->hasRight('societe', 'lire');
|
||||||
$permissiontodelete = $user->rights->societe->supprimer;
|
$permissiontodelete = $user->rights->societe->supprimer;
|
||||||
$permissiontoadd = $user->rights->societe->creer;
|
$permissiontoadd = $user->rights->societe->creer;
|
||||||
$uploaddir = $conf->societe->dir_output;
|
$uploaddir = $conf->societe->dir_output;
|
||||||
|
|||||||
@ -395,7 +395,7 @@ if (empty($reshook)) {
|
|||||||
// Mass actions
|
// Mass actions
|
||||||
$objectclass = 'Bookkeeping';
|
$objectclass = 'Bookkeeping';
|
||||||
$objectlabel = 'Bookkeeping';
|
$objectlabel = 'Bookkeeping';
|
||||||
$permissiontoread = $user->rights->societe->lire;
|
$permissiontoread = $user->hasRight('societe', 'lire');
|
||||||
$permissiontodelete = $user->rights->societe->supprimer;
|
$permissiontodelete = $user->rights->societe->supprimer;
|
||||||
$permissiontoadd = $user->rights->societe->creer;
|
$permissiontoadd = $user->rights->societe->creer;
|
||||||
$uploaddir = $conf->societe->dir_output;
|
$uploaddir = $conf->societe->dir_output;
|
||||||
|
|||||||
@ -272,7 +272,7 @@ class Documents extends DolibarrApi
|
|||||||
if ($modulepart == 'societe' || $modulepart == 'thirdparty') {
|
if ($modulepart == 'societe' || $modulepart == 'thirdparty') {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||||
|
|
||||||
if (!DolibarrApiAccess::$user->rights->societe->lire) {
|
if (!DolibarrApiAccess::$user->hasRight('societe', 'lire')) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -315,7 +315,7 @@ class Categories extends DolibarrApi
|
|||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
} elseif ($type == Categorie::TYPE_CONTACT && !DolibarrApiAccess::$user->rights->contact->lire) {
|
} elseif ($type == Categorie::TYPE_CONTACT && !DolibarrApiAccess::$user->rights->contact->lire) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
} elseif ($type == Categorie::TYPE_CUSTOMER && !DolibarrApiAccess::$user->rights->societe->lire) {
|
} elseif ($type == Categorie::TYPE_CUSTOMER && !DolibarrApiAccess::$user->hasRight('societe', 'lire')) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
} elseif ($type == Categorie::TYPE_SUPPLIER && !DolibarrApiAccess::$user->rights->fournisseur->lire) {
|
} elseif ($type == Categorie::TYPE_SUPPLIER && !DolibarrApiAccess::$user->rights->fournisseur->lire) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user