Ajout permissions sur les factures

This commit is contained in:
Rodolphe Quiedeville 2003-08-12 13:27:08 +00:00
parent bcdb3174ad
commit 9bf2be64d9

View File

@ -176,23 +176,6 @@ class User
*/ */
Function getrights($module='') Function getrights($module='')
{ {
/*
+----+---------------------------------------------------+---------+------+
| id | libelle | module | type |
+----+---------------------------------------------------+---------+------+
| 1 | Tous les droits | all | a |
| 10 | Tous les droits sur les factures | facture | a |
| 11 | Lire les factures | facture | r |
| 12 | Créer modifier les factures | facture | w |
| 13 | Modifier les factures d'autrui | facture | m |
| 14 | Supprimer les factures | facture | d |
| 20 | Tous les droits sur les propositions commerciales | propale | a |
| 21 | Lire les propositions commerciales | propale | r |
| 22 | Créer modifier les propositions commerciales | propale | w |
| 23 | Modifier les propositions commerciales d'autrui | propale | m |
| 24 | Supprimer les propositions commerciales | propale | d |
+----+---------------------------------------------------+---------+------+
*/
$sql = "SELECT fk_user, fk_id FROM llx_user_rights WHERE fk_user= $this->id"; $sql = "SELECT fk_user, fk_id FROM llx_user_rights WHERE fk_user= $this->id";
/* /*
if ($module) if ($module)
@ -210,15 +193,6 @@ class User
$obj = $this->db->fetch_object($i); $obj = $this->db->fetch_object($i);
if ($module == 'facture' or $module == '') if ($module == 'facture' or $module == '')
{
if ($obj->fk_id == 1 or $obj->fk_id == 10)
{
$this->rights->facture->lire = 1;
$this->rights->facture->creer = 1;
$this->rights->facture->modifier = 1;
$this->rights->facture->supprimer = 1;
}
else
{ {
if ($obj->fk_id == 11) if ($obj->fk_id == 11)
$this->rights->facture->lire = 1; $this->rights->facture->lire = 1;
@ -230,19 +204,19 @@ class User
$this->rights->facture->modifier = 1; $this->rights->facture->modifier = 1;
if ($obj->fk_id == 14) if ($obj->fk_id == 14)
$this->rights->facture->valider = 1;
if ($obj->fk_id == 15)
$this->rights->facture->envoyer = 1;
if ($obj->fk_id == 16)
$this->rights->facture->paiement = 1;
if ($obj->fk_id == 19)
$this->rights->facture->supprimer = 1; $this->rights->facture->supprimer = 1;
}
} }
if ($module == 'propale' or $module == '') if ($module == 'propale' or $module == '')
{
if ($obj->fk_id == 1 or $obj->fk_id == 20)
{
$this->rights->propale->lire = 1;
$this->rights->propale->creer = 1;
$this->rights->propale->modifier = 1;
$this->rights->propale->supprimer = 1;
}
else
{ {
if ($obj->fk_id == 21) if ($obj->fk_id == 21)
$this->rights->propale->lire = 1; $this->rights->propale->lire = 1;
@ -265,18 +239,10 @@ class User
if ($obj->fk_id == 27) if ($obj->fk_id == 27)
$this->rights->propale->supprimer = 1; $this->rights->propale->supprimer = 1;
} }
}
if ($module == 'produit' or $module == '') if ($module == 'produit' or $module == '')
{ {
if ($obj->fk_id == 1 or $obj->fk_id == 30)
{
$this->rights->produit->lire = 1;
$this->rights->produit->creer = 1;
$this->rights->produit->modifier = 1;
$this->rights->produit->supprimer = 1;
}
else
{
if ($obj->fk_id == 31) if ($obj->fk_id == 31)
$this->rights->produit->lire = 1; $this->rights->produit->lire = 1;
@ -288,19 +254,11 @@ class User
if ($obj->fk_id == 34) if ($obj->fk_id == 34)
$this->rights->produit->supprimer = 1; $this->rights->produit->supprimer = 1;
}
} }
if ($module == 'projet' or $module == '') if ($module == 'projet' or $module == '')
{ {
if ($obj->fk_id == 1 or $obj->fk_id == 40)
{
$this->rights->projet->lire = 1;
$this->rights->projet->creer = 1;
$this->rights->projet->modifier = 1;
$this->rights->projet->supprimer = 1;
}
else
{
if ($obj->fk_id == 41) if ($obj->fk_id == 41)
$this->rights->projet->lire = 1; $this->rights->projet->lire = 1;
@ -312,7 +270,7 @@ class User
if ($obj->fk_id == 44) if ($obj->fk_id == 44)
$this->rights->projet->supprimer = 1; $this->rights->projet->supprimer = 1;
}
} }
$i++; $i++;
} }