Ajout de rgle de scurit

This commit is contained in:
Regis Houssin 2005-07-23 14:48:58 +00:00
parent 034531021e
commit d730987065
4 changed files with 53 additions and 20 deletions

View File

@ -52,15 +52,22 @@ function llxHeader($head = "", $title = "", $help_url='', $addons='')
{
$menu->add($addons[0][0], $addons[0][1]);
}
if ($user->societe_id == 0 && $user->rights->societe->lire)
{
$menu->add(DOL_URL_ROOT."/fourn/index.php", $langs->trans("Suppliers"));
$menu->add_submenu(DOL_URL_ROOT."/fourn/contact.php",$langs->trans("Contacts"));
}
$langs->load("bills");
if ($user->rights->fournisseur->facture->lire)
{
$menu->add(DOL_URL_ROOT."/fourn/facture/index.php", $langs->trans("Bills"));
}
if ($user->rights->fournisseur->commande->lire)
{
$menu->add(DOL_URL_ROOT."/fourn/commande/", $langs->trans("Orders"));
$menu->add_submenu(DOL_URL_ROOT."/fourn/commande/liste.php", $langs->trans("List"));
}
left_menu($menu->liste,$help_url);
}

View File

@ -53,10 +53,13 @@ function llxHeader($head = "", $title = "", $addons='') {
if ($conf->fournisseur->enabled)
{
if ($user->rights->societe->lire)
{
$menu->add(DOL_URL_ROOT."/fourn/index.php", $langs->trans("Suppliers"));
}
// Sécurité accés client
if ($user->societe_id == 0)
if ($user->societe_id == 0 && $user->rights->societe->creer)
{
$menu->add_submenu(DOL_URL_ROOT."/soc.php?action=create&type=f",$langs->trans("NewSupplier"));
}
@ -64,24 +67,35 @@ function llxHeader($head = "", $title = "", $addons='') {
if ($conf->societe->enabled)
{
$menu->add_submenu(DOL_URL_ROOT."/fourn/contact.php",$langs->trans("Contacts"));
if ($user->rights->societe->lire)
{
$menu->add_submenu(DOL_URL_ROOT."/fourn/contact.php",$langs->trans("Contacts"));
}
}
$langs->load("bills");
$menu->add(DOL_URL_ROOT."/fourn/facture/index.php", $langs->trans("Bills"));
if ($user->rights->fournisseur->facture->lire)
{
$menu->add(DOL_URL_ROOT."/fourn/facture/index.php", $langs->trans("Bills"));
}
if ($user->rights->fournisseur->facture->creer)
{
$menu->add_submenu(DOL_URL_ROOT."/fourn/facture/fiche.php?action=create",$langs->trans("NewBill"));
}
$menu->add_submenu(DOL_URL_ROOT."/fourn/facture/paiement.php", $langs->trans("Payments"));
if ($user->rights->fournisseur->facture->lire)
{
$menu->add_submenu(DOL_URL_ROOT."/fourn/facture/paiement.php", $langs->trans("Payments"));
}
$langs->load("orders");
$menu->add(DOL_URL_ROOT."/fourn/commande/",$langs->trans("Orders"));
if ($user->rights->fournisseur->commande->lire)
{
$menu->add(DOL_URL_ROOT."/fourn/commande/",$langs->trans("Orders"));
}
if ($conf->produit->enabled || $conf->service->enabled)

View File

@ -30,6 +30,10 @@
require("./pre.inc.php");
if (!$user->rights->societe->lire)
accessforbidden();
$page = $_GET["page"];
$sortorder = $_GET["sortorder"];
$sortfield = $_GET["sortfield"];

View File

@ -50,39 +50,47 @@ function llxHeader($head = "", $title="", $addons='') {
$menu->add($addons[0][0], $addons[0][1]);
}
if ($conf->fournisseur->enabled)
if ($conf->fournisseur->enabled && $user->rights->societe->lire)
{
$menu->add(DOL_URL_ROOT."/fourn/index.php", $langs->trans("Suppliers"));
// Sécurité accés client
if ($user->societe_id == 0)
if ($user->societe_id == 0 && $user->rights->societe->creer)
{
$menu->add_submenu(DOL_URL_ROOT."/soc.php?action=create&type=f",$langs->trans("NewSupplier"));
}
}
if ($conf->societe->enabled)
if ($conf->societe->enabled && $user->rights->societe->lire)
{
$menu->add_submenu(DOL_URL_ROOT."/fourn/contact.php",$langs->trans("Contacts"));
}
$langs->load("bills");
$menu->add(DOL_URL_ROOT."/fourn/facture/index.php", $langs->trans("Bills"));
if ($user->societe_id == 0)
if ($user->societe_id == 0 && $user->rights->fournisseur->facture->lire)
{
$menu->add(DOL_URL_ROOT."/fourn/facture/index.php", $langs->trans("Bills"));
}
if ($user->societe_id == 0 && $user->rights->fournisseur->facture->creer)
{
$menu->add_submenu(DOL_URL_ROOT."/fourn/facture/fiche.php?action=create",$langs->trans("NewBill"));
}
$menu->add_submenu(DOL_URL_ROOT."/fourn/facture/paiement.php", $langs->trans("Payments"));
if ($user->rights->fournisseur->facture->lire)
{
$menu->add_submenu(DOL_URL_ROOT."/fourn/facture/paiement.php", $langs->trans("Payments"));
}
$langs->load("orders");
$menu->add(DOL_URL_ROOT."/fourn/commande/",$langs->trans("Orders"));
if ($user->rights->fournisseur->commande->lire)
{
$menu->add(DOL_URL_ROOT."/fourn/commande/",$langs->trans("Orders"));
}
if ($conf->produit->enabled || $conf->service->enabled)
{
$menu->add(DOL_URL_ROOT."/fourn/product/", $langs->trans("Products"));
if ($user->rights->produit->lire)
{
$menu->add(DOL_URL_ROOT."/fourn/product/", $langs->trans("Products"));
}
}
left_menu($menu->liste);