Fix perm
This commit is contained in:
parent
a92f60416a
commit
280059a3d7
@ -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)
|
||||
{
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/ecm/index.php
|
||||
* \file htdocs/ecm/search.php
|
||||
* \ingroup ecm
|
||||
* \brief Page to make advanced search into ECM
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user