diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php
index 665940b8083..bc4d6daaaa4 100644
--- a/htdocs/product/stock/product.php
+++ b/htdocs/product/stock/product.php
@@ -111,7 +111,8 @@ $parameters=array('id'=>$id, 'ref'=>$ref, 'objcanvas'=>$objcanvas);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
-if ($action == 'addlimitstockwarehouse') {
+if ($action == 'addlimitstockwarehouse' && !empty($user->rights->produit->creer))
+{
$seuil_stock_alerte = GETPOST('seuil_stock_alerte');
$desiredstock = GETPOST('desiredstock');
@@ -154,7 +155,7 @@ if ($action == 'addlimitstockwarehouse') {
}
-if($action == 'delete_productstockwarehouse')
+if($action == 'delete_productstockwarehouse' && !empty($user->rights->produit->creer))
{
$pse = new ProductStockEntrepot($db);
@@ -166,7 +167,7 @@ if($action == 'delete_productstockwarehouse')
}
// Set stock limit
-if ($action == 'setseuil_stock_alerte')
+if ($action == 'setseuil_stock_alerte' && !empty($user->rights->produit->creer))
{
$object = new Product($db);
$result=$object->fetch($id);
@@ -180,7 +181,7 @@ if ($action == 'setseuil_stock_alerte')
}
// Set desired stock
-if ($action == 'setdesiredstock')
+if ($action == 'setdesiredstock' && !empty($user->rights->produit->creer))
{
$object = new Product($db);
$result=$object->fetch($id);
@@ -947,16 +948,24 @@ if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE))
print '
';
print_titre($langs->trans('AddNewProductStockWarehouse'));
- print '