Ajout des droits

This commit is contained in:
Rodolphe Quiedeville 2003-08-06 12:25:49 +00:00
parent ead6c895f7
commit b356331ab2

View File

@ -24,11 +24,19 @@ require("./pre.inc.php3");
require("../propal.class.php3"); require("../propal.class.php3");
require("../facture.class.php3"); require("../facture.class.php3");
llxHeader(); $user->getrights('produit');
$db = new Db();
$mesg = ''; $mesg = '';
if (!$user->rights->produit->lire)
{
llxHeader();
print "Accés non authorisé";
llxFooter();
exit;
}
llxHeader();
if ($action == 'add') if ($action == 'add')
{ {
$product = new Product($db); $product = new Product($db);
@ -71,7 +79,7 @@ if ($action == 'addinfacture')
$mesg .= '<a href="../compta/facture.php3?facid='.$facture->id.'">'.$facture->ref.'</a>'; $mesg .= '<a href="../compta/facture.php3?facid='.$facture->id.'">'.$facture->ref.'</a>';
} }
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); $product = new Product($db);
@ -305,9 +313,16 @@ if ($action == 'create')
print '<td width="20%" align="center">-</td>'; print '<td width="20%" align="center">-</td>';
} }
else else
{
if ($user->rights->produit->modifier || $user->rights->produit->creer)
{ {
print '<td width="20%" align="center">[<a href="fiche.php3?action=edit&id='.$id.'">Editer</a>]</td>'; print '<td width="20%" align="center">[<a href="fiche.php3?action=edit&id='.$id.'">Editer</a>]</td>';
} }
else
{
print '<td width="20%" align="center">-</td>';
}
}
print '<td width="20%" align="center">-</td>'; print '<td width="20%" align="center">-</td>';
print '</table><br>'; print '</table><br>';