Browse Source

FIX - php V8 user right box

Anthony Berton 2 years ago
parent
commit
c1b98e8e73

+ 1 - 1
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'));
 	}
 
 	/**

+ 1 - 1
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'));
 	}
 
 	/**

+ 1 - 1
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'));
 	}
 
 	/**

+ 1 - 1
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'));
 	}
 
 	/**

+ 1 - 1
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'));
 	}
 
 	/**

+ 1 - 1
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'));
 	}
 
 	/**

+ 1 - 1
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'));
 	}
 
 	/**

+ 1 - 1
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'));
 	}
 
 	/**

+ 1 - 1
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'));
 	}
 
 	/**

+ 1 - 1
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'));
 	}
 
 	/**