From 0e98972028d3a5a20ab49489e6922be9d577cd13 Mon Sep 17 00:00:00 2001
From: Regis Houssin <regis@dolibarr.fr>
Date: Sun, 4 May 2008 16:21:40 +0000
Subject: [PATCH] =?UTF-8?q?Fix:=20ajout=20des=20droits=20d'acc=E8s=20sur?=
 =?UTF-8?q?=20les=20documents=20Todo:=20pr=E9voir=20un=20droit=20de=20supp?=
 =?UTF-8?q?ression=20des=20documents?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 htdocs/ecm/docdir.php | 1 +
 htdocs/ecm/index.php  | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/htdocs/ecm/docdir.php b/htdocs/ecm/docdir.php
index bbae295b361..f75d0668bfd 100644
--- a/htdocs/ecm/docdir.php
+++ b/htdocs/ecm/docdir.php
@@ -44,6 +44,7 @@ $langs->load("categories");
 // Load permissions
 $user->getrights('ecm');
 
+if (!$user->rights->ecm->create) accessforbidden();
 
 // Get parameters
 $socid = isset($_GET["socid"])?$_GET["socid"]:'';
diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php
index d98b221f24d..577bbda7ebf 100644
--- a/htdocs/ecm/index.php
+++ b/htdocs/ecm/index.php
@@ -255,7 +255,7 @@ print '<td class="liste_titre" align="right">'.$langs->trans("ECMNbOfDocsSmall")
 print '<a href="'.$_SERVER["PHP_SELF"].'?action=refreshauto">'.img_picto($langs->trans("Refresh"),'refresh').'</a>';
 print '</td>';
 print '<td class="liste_titre" align="right">';
-if ($user->rights->ecm->create)
+if ($user->rights->ecm->setup)
 {
 	print '<a href="'.DOL_URL_ROOT.'/ecm/docdir?action=create">'.img_picto($langs->trans("ECMNewSection"),'edit_add').'</a>';
 }
-- 
GitLab