diff --git a/htdocs/product/fiche.php3 b/htdocs/product/fiche.php3 index c19b7e318b3..26cd17a126c 100644 --- a/htdocs/product/fiche.php3 +++ b/htdocs/product/fiche.php3 @@ -24,11 +24,19 @@ require("./pre.inc.php3"); require("../propal.class.php3"); require("../facture.class.php3"); -llxHeader(); - -$db = new Db(); +$user->getrights('produit'); $mesg = ''; +if (!$user->rights->produit->lire) +{ + llxHeader(); + print "Accés non authorisé"; + llxFooter(); + exit; +} + +llxHeader(); + if ($action == 'add') { $product = new Product($db); @@ -71,7 +79,7 @@ if ($action == 'addinfacture') $mesg .= ''.$facture->ref.''; } -if ($action == 'update' && $cancel <> 'Annuler') +if ($HTTP_POST_VARS["action"] == 'update' && $cancel <> 'Annuler' && ( $user->rights->produit->modifier || $user->rights->produit->creer)) { $product = new Product($db); @@ -306,7 +314,14 @@ if ($action == 'create') } else { - print '[Editer]'; + if ($user->rights->produit->modifier || $user->rights->produit->creer) + { + print '[Editer]'; + } + else + { + print '-'; + } } print '-'; print '
';