Fix delete customer payment

This commit is contained in:
Maxime Kohlhaas 2022-05-22 02:30:35 +02:00
parent 6aa4ce2acb
commit c3fb7647c5
2 changed files with 4 additions and 2 deletions

View File

@ -48,7 +48,7 @@ $object = new Paiement($db);
// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
$result = restrictedArea($user, $object->element, $object->id, 'paiement', '');
$result = restrictedArea($user, $object->element, $object->id, 'paiement');
// Security check
if ($user->socid) $socid = $user->socid;

View File

@ -185,7 +185,7 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
//dol_syslog("functions.lib:restrictedArea $feature, $objectid, $dbtablename, $feature2, $dbt_socfield, $dbt_select, $isdraft");
//print "user_id=".$user->id.", features=".$features.", feature2=".$feature2.", objectid=".$objectid;
//print ", dbtablename=".$dbtablename.", dbt_socfield=".$dbt_keyfield.", dbt_select=".$dbt_select;
//print ", dbtablename=".$tableandshare.", dbt_socfield=".$dbt_keyfield.", dbt_select=".$dbt_select;
//print ", perm: ".$features."->".$feature2."=".($user->rights->$features->$feature2->lire)."<br>";
$parentfortableentity = '';
@ -374,6 +374,8 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
} elseif ($feature == 'salaries')
{
if (!$user->rights->salaries->delete) $deleteok = 0;
} elseif ($feature == 'payment') {
if (!$user->rights->facture->paiement) $deleteok = 0;
} elseif ($feature == 'payment_supplier')
{
if (!$user->rights->fournisseur->facture->creer) { $deleteok = 0; }