This commit is contained in:
Laurent Destailleur 2018-01-07 18:56:57 +01:00
parent a92f60416a
commit 280059a3d7
2 changed files with 19 additions and 5 deletions

View File

@ -18,7 +18,7 @@
*/
/**
* \file htdocs/ecm/docdir.php
* \file htdocs/ecm/dir_add_card.php
* \ingroup ecm
* \brief Main page for ECM section area
*/
@ -31,8 +31,6 @@ require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmdirectory.class.php';
// Load traductions files
$langs->loadLangs(array("ecm","companies","other","users","orders","propal","bills","contracts","categories"));
if (! $user->rights->ecm->setup) accessforbidden();
// Get parameters
$socid = GETPOST('socid','int');
$action = GETPOST('action','alpha');
@ -85,13 +83,29 @@ if (! empty($section))
}
}
$permtoadd = 0;
$permtoupload = 0;
if ($module == 'ecm')
{
$permtoadd = $user->rights->ecm->setup;
$permtoupload = $user->rights->ecm->upload;
}
if ($module == 'medias')
{
$permtoadd = ($user->rights->mailing->creer || $user->rights->website->write);
$permtoupload = ($user->rights->mailing->creer || $user->rights->website->write);
}
if (! $permtoadd) accessforbidden();
/*
* Actions
*/
// Action ajout d'un produit ou service
if ($action == 'add' && $user->rights->ecm->setup)
if ($action == 'add' && $permtoadd)
{
if ($cancel)
{

View File

@ -17,7 +17,7 @@
*/
/**
* \file htdocs/ecm/index.php
* \file htdocs/ecm/search.php
* \ingroup ecm
* \brief Page to make advanced search into ECM
*/