diff --git a/htdocs/compta/prelevement/config.php b/htdocs/compta/prelevement/config.php
index ea44e78199e..cd93ed55b71 100644
--- a/htdocs/compta/prelevement/config.php
+++ b/htdocs/compta/prelevement/config.php
@@ -30,9 +30,7 @@ require("./pre.inc.php");
$langs->load("admin");
-if (!$user->admin) accessforbidden();
-
-if ($_GET["action"] == "set" && $user->admin)
+if ($_GET["action"] == "set" && $user->rights->prelevement->bons->configurer)
{
for ($i = 1 ; $i < 7 ; $i++)
{
@@ -42,7 +40,7 @@ if ($_GET["action"] == "set" && $user->admin)
Header("Location: config.php");
}
-if ($_GET["action"] == "addnotif")
+if ($_GET["action"] == "addnotif" && $user->rights->prelevement->bons->configurer)
{
$bon = new BonPrelevement($db);
$bon->AddNotification($_POST["user"],$_POST["action"]);
@@ -50,7 +48,7 @@ if ($_GET["action"] == "addnotif")
Header("Location: config.php");
}
-if ($_GET["action"] == "deletenotif")
+if ($_GET["action"] == "deletenotif" && $user->rights->prelevement->bons->configurer)
{
$bon = new BonPrelevement($db);
$bon->DeleteNotificationById($_GET["notif"]);
@@ -72,66 +70,87 @@ print "
";
*
*
*/
+if ($user->rights->prelevement->bons->configurer)
+ print '