diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index a4f1a30bd4d..1aec703de4a 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -233,28 +233,22 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f continue; } - if ($feature == 'societe') - { + if ($feature == 'societe') { if (!$user->rights->societe->lire && !$user->rights->fournisseur->lire) { $readok = 0; $nbko++; } } - elseif ($feature == 'contact') - { + elseif ($feature == 'contact') { if (!$user->rights->societe->contact->lire) { $readok = 0; $nbko++; } } - elseif ($feature == 'produit|service') - { + elseif ($feature == 'produit|service') { if (!$user->rights->produit->lire && !$user->rights->service->lire) { $readok = 0; $nbko++; } } - elseif ($feature == 'prelevement') - { + elseif ($feature == 'prelevement') { if (!$user->rights->prelevement->bons->lire) { $readok = 0; $nbko++; } } - elseif ($feature == 'cheque') - { + elseif ($feature == 'cheque') { if (!$user->rights->banque->cheque) { $readok = 0; $nbko++; } } - elseif ($feature == 'projet') - { + elseif ($feature == 'projet') { if (!$user->rights->projet->lire && !$user->rights->projet->all->lire) { $readok = 0; $nbko++; } } elseif (!empty($feature2)) // This is for permissions on 2 levels @@ -296,30 +290,27 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f { foreach ($featuresarray as $feature) { - if ($feature == 'contact') - { + if ($feature == 'contact') { if (!$user->rights->societe->contact->creer) { $createok = 0; $nbko++; } } - elseif ($feature == 'produit|service') - { + elseif ($feature == 'produit|service') { if (!$user->rights->produit->creer && !$user->rights->service->creer) { $createok = 0; $nbko++; } } - elseif ($feature == 'prelevement') - { + elseif ($feature == 'prelevement') { if (!$user->rights->prelevement->bons->creer) { $createok = 0; $nbko++; } } - elseif ($feature == 'commande_fournisseur') - { + elseif ($feature == 'commande_fournisseur') { if (!$user->rights->fournisseur->commande->creer) { $createok = 0; $nbko++; } } - elseif ($feature == 'banque') - { + elseif ($feature == 'banque') { if (!$user->rights->banque->modifier) { $createok = 0; $nbko++; } } - elseif ($feature == 'cheque') - { + elseif ($feature == 'cheque') { if (!$user->rights->banque->cheque) { $createok = 0; $nbko++; } } + elseif ($feature == 'ecm') { + if (!$user->rights->ecm->upload) { $createok = 0; $nbko++; } + } elseif (!empty($feature2)) // This is for permissions on one level { foreach ($feature2 as $subfeature) diff --git a/htdocs/core/modules/modECM.class.php b/htdocs/core/modules/modECM.class.php index 4d314644fb4..637cdb33739 100644 --- a/htdocs/core/modules/modECM.class.php +++ b/htdocs/core/modules/modECM.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2010 Laurent Destailleur + * Copyright (C) 2004-2020 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -97,21 +97,21 @@ class modECM extends DolibarrModules $r++; $this->rights[$r][0] = 2501; - $this->rights[$r][1] = 'Consulter/Télécharger les documents'; + $this->rights[$r][1] = 'Read or download documents'; $this->rights[$r][2] = 'r'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'read'; $r++; $this->rights[$r][0] = 2503; - $this->rights[$r][1] = 'Soumettre ou supprimer des documents'; + $this->rights[$r][1] = 'Upload a document'; $this->rights[$r][2] = 'w'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'upload'; $r++; $this->rights[$r][0] = 2515; - $this->rights[$r][1] = 'Administrer les rubriques de documents'; + $this->rights[$r][1] = 'Administer directories of documents'; $this->rights[$r][2] = 'w'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'setup';