diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php index 551b892f0f7..fb0f93086d2 100644 --- a/htdocs/core/boxes/box_actions.php +++ b/htdocs/core/boxes/box_actions.php @@ -62,7 +62,7 @@ class box_actions extends ModeleBoxes $this->enabled = $conf->agenda->enabled; - $this->hidden = !($user->rights->agenda->myactions->read); + $this->hidden = !($user->hasRight('agenda', 'myactions', 'read')); } /** diff --git a/htdocs/core/boxes/box_contacts.php b/htdocs/core/boxes/box_contacts.php index ea35a080d0e..f257d7db18d 100644 --- a/htdocs/core/boxes/box_contacts.php +++ b/htdocs/core/boxes/box_contacts.php @@ -63,7 +63,7 @@ class box_contacts extends ModeleBoxes $this->db = $db; - $this->hidden = !($user->rights->societe->lire && $user->rights->societe->contact->lire); + $this->hidden = !($user->hasRight('societe', 'lire') && $user->hasRight('societe', 'contact', 'lire')); } /** diff --git a/htdocs/core/boxes/box_contracts.php b/htdocs/core/boxes/box_contracts.php index dddafffdc02..99ea5541c98 100644 --- a/htdocs/core/boxes/box_contracts.php +++ b/htdocs/core/boxes/box_contracts.php @@ -59,7 +59,7 @@ class box_contracts extends ModeleBoxes $this->db = $db; - $this->hidden = !($user->rights->contrat->lire); + $this->hidden = !($user->hasRight('contrat', 'lire')); } /** diff --git a/htdocs/core/boxes/box_factures_fourn.php b/htdocs/core/boxes/box_factures_fourn.php index 5fc3bdafa38..06124d4ab35 100644 --- a/htdocs/core/boxes/box_factures_fourn.php +++ b/htdocs/core/boxes/box_factures_fourn.php @@ -59,7 +59,7 @@ class box_factures_fourn extends ModeleBoxes $this->db = $db; - $this->hidden = !($user->rights->fournisseur->facture->lire); + $this->hidden = !($user->hasRight('fournisseur', 'facture', 'lire')); } /** diff --git a/htdocs/core/boxes/box_factures_fourn_imp.php b/htdocs/core/boxes/box_factures_fourn_imp.php index d8c9321411d..ad6c6c97c27 100644 --- a/htdocs/core/boxes/box_factures_fourn_imp.php +++ b/htdocs/core/boxes/box_factures_fourn_imp.php @@ -58,7 +58,7 @@ class box_factures_fourn_imp extends ModeleBoxes $this->db = $db; - $this->hidden = !($user->rights->fournisseur->facture->lire); + $this->hidden = !($user->hasRight('fournisseur', 'facture', 'lire')); } /** diff --git a/htdocs/core/boxes/box_ficheinter.php b/htdocs/core/boxes/box_ficheinter.php index b0f0e691471..f69ccb0ad94 100644 --- a/htdocs/core/boxes/box_ficheinter.php +++ b/htdocs/core/boxes/box_ficheinter.php @@ -59,7 +59,7 @@ class box_ficheinter extends ModeleBoxes $this->db = $db; - $this->hidden = !($user->rights->ficheinter->lire); + $this->hidden = !($user->hasRight('ficheinter', 'lire')); } /** diff --git a/htdocs/core/boxes/box_propales.php b/htdocs/core/boxes/box_propales.php index cdaf629ae3f..8e8efc8d8f3 100644 --- a/htdocs/core/boxes/box_propales.php +++ b/htdocs/core/boxes/box_propales.php @@ -61,7 +61,7 @@ class box_propales extends ModeleBoxes $this->db = $db; - $this->hidden = !($user->rights->propale->lire); + $this->hidden = !($user->hasRight('propale', 'lire')); } /** diff --git a/htdocs/core/boxes/box_services_expired.php b/htdocs/core/boxes/box_services_expired.php index e9cca792de1..25fa5ca2b1f 100644 --- a/htdocs/core/boxes/box_services_expired.php +++ b/htdocs/core/boxes/box_services_expired.php @@ -58,7 +58,7 @@ class box_services_expired extends ModeleBoxes $this->db = $db; - $this->hidden = !($user->rights->contrat->lire); + $this->hidden = !($user->hasRight('contrat', 'lire')); } /** diff --git a/htdocs/core/boxes/box_supplier_orders.php b/htdocs/core/boxes/box_supplier_orders.php index 6ee0c5ef8a3..f3db3526bb6 100644 --- a/htdocs/core/boxes/box_supplier_orders.php +++ b/htdocs/core/boxes/box_supplier_orders.php @@ -58,7 +58,7 @@ class box_supplier_orders extends ModeleBoxes $this->db = $db; - $this->hidden = !($user->rights->fournisseur->commande->lire); + $this->hidden = !($user->hasRight('fournisseur', 'commande', 'lire')); } /** diff --git a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php index 32151828b83..ce0161582de 100644 --- a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php +++ b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php @@ -58,7 +58,7 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes $this->db = $db; - $this->hidden = !($user->rights->fournisseur->commande->lire); + $this->hidden = !($user->hasRight('fournisseur', 'commande', 'lire')); } /**