Withdrawls: Add user permission control

This commit is contained in:
Juanjo Menent 2011-01-15 08:51:22 +00:00
parent 59fa268fd9
commit e16eda8308

View File

@ -143,7 +143,7 @@ if ($_GET["id"])
dol_print_error($db); dol_print_error($db);
} }
if ($_GET["action"] == 'rejet') if ($_GET["action"] == 'rejet' && $user->rights->prelevement->bons->creer)
{ {
$html = new Form($db); $html = new Form($db);
@ -200,10 +200,14 @@ if ($_GET["id"])
if ($_GET["action"] == '') if ($_GET["action"] == '')
{ {
if ($bon->statut == 2 && $lipre->statut == 2) if ($bon->statut == 2 && $lipre->statut == 2 && $user->rights->prelevement->bons->credit)
{ {
print "<a class=\"butAction\" href=\"ligne.php?action=rejet&amp;id=$lipre->id\">".$langs->trans("StandingOrderReject")."</a>"; print "<a class=\"butAction\" href=\"ligne.php?action=rejet&amp;id=$lipre->id\">".$langs->trans("StandingOrderReject")."</a>";
} }
else
{
print "<a class=\"butActionRefused\" href=\"#\">".$langs->trans("StandingOrderReject")."</a>";
}
} }
print "</div>"; print "</div>";