diff --git a/src/Controller/AppController.php b/src/Controller/AppController.php index 34c998c..420bff4 100755 --- a/src/Controller/AppController.php +++ b/src/Controller/AppController.php @@ -99,7 +99,7 @@ class AppController extends Controller { * Autorisations fréquentes utilisées par bcp de isAuthorized() de controlleurs * Ca évite de répéter 10 fois la meme chose !!! */ - public function isAuthorizedCommons() { + public function isAuthorizedCommons($user) { $action = $this->getActionPassed(); //$role = $this->getUserRole($user); @@ -111,7 +111,8 @@ class AppController extends Controller { } // By default - return parent::isAuthorized($user); + //return parent::isAuthorized($user); + return AppController::isAuthorized($user); } /** diff --git a/src/Controller/CategoriesController.php b/src/Controller/CategoriesController.php index fc8220a..5b62174 100755 --- a/src/Controller/CategoriesController.php +++ b/src/Controller/CategoriesController.php @@ -59,7 +59,7 @@ class CategoriesController extends AppController //return false; //return parent::isAuthorized($user); - return $this->isAuthorizedCommons(); + return $this->isAuthorizedCommons($user); } /** diff --git a/src/Controller/FournisseursController.php b/src/Controller/FournisseursController.php index 8c75791..d16de38 100644 --- a/src/Controller/FournisseursController.php +++ b/src/Controller/FournisseursController.php @@ -51,7 +51,7 @@ class FournisseursController extends AppController //return false; //return parent::isAuthorized($user); - return $this->isAuthorizedCommons(); + return $this->isAuthorizedCommons($user); } diff --git a/src/Controller/GroupesMetiersController.php b/src/Controller/GroupesMetiersController.php index d4d32c4..c62680b 100755 --- a/src/Controller/GroupesMetiersController.php +++ b/src/Controller/GroupesMetiersController.php @@ -58,7 +58,7 @@ class GroupesMetiersController extends AppController //return false; //return parent::isAuthorized($user); - return $this->isAuthorizedCommons(); + return $this->isAuthorizedCommons($user); } diff --git a/src/Controller/GroupesThematiquesController.php b/src/Controller/GroupesThematiquesController.php index 0ffa8d1..883f6bd 100755 --- a/src/Controller/GroupesThematiquesController.php +++ b/src/Controller/GroupesThematiquesController.php @@ -49,7 +49,7 @@ class GroupesThematiquesController extends AppController // Par défaut //return false; //return parent::isAuthorized($user); - return $this->isAuthorizedCommons(); + return $this->isAuthorizedCommons($user); } diff --git a/src/Controller/OrganismesController.php b/src/Controller/OrganismesController.php index e1326b7..cbfac29 100755 --- a/src/Controller/OrganismesController.php +++ b/src/Controller/OrganismesController.php @@ -55,7 +55,7 @@ class OrganismesController extends AppController // Par défaut //return false; //return parent::isAuthorized($user); - return $this->isAuthorizedCommons(); + return $this->isAuthorizedCommons($user); } /** diff --git a/src/Controller/SitesController.php b/src/Controller/SitesController.php index fe7ec17..850683e 100755 --- a/src/Controller/SitesController.php +++ b/src/Controller/SitesController.php @@ -45,7 +45,7 @@ class SitesController extends AppController */ //return false; - return $this->isAuthorizedCommons(); + return $this->isAuthorizedCommons($user); } diff --git a/src/Controller/SousCategoriesController.php b/src/Controller/SousCategoriesController.php index 18da378..117aafa 100755 --- a/src/Controller/SousCategoriesController.php +++ b/src/Controller/SousCategoriesController.php @@ -46,7 +46,7 @@ class SousCategoriesController extends AppController return false; */ - return $this->isAuthorizedCommons(); + return $this->isAuthorizedCommons($user); } diff --git a/src/Controller/SurCategoriesController.php b/src/Controller/SurCategoriesController.php index 49dc0ee..9d5a780 100755 --- a/src/Controller/SurCategoriesController.php +++ b/src/Controller/SurCategoriesController.php @@ -45,7 +45,7 @@ class SurCategoriesController extends AppController return false; */ - return $this->isAuthorizedCommons(); + return $this->isAuthorizedCommons($user); } diff --git a/src/Controller/TypeDocumentsController.php b/src/Controller/TypeDocumentsController.php index 18df540..8fde24e 100755 --- a/src/Controller/TypeDocumentsController.php +++ b/src/Controller/TypeDocumentsController.php @@ -41,7 +41,7 @@ class TypeDocumentsController extends AppController return false; */ - return $this->isAuthorizedCommons(); + return $this->isAuthorizedCommons($user); } diff --git a/src/Controller/TypeSuivisController.php b/src/Controller/TypeSuivisController.php index 114400b..23c0f1f 100755 --- a/src/Controller/TypeSuivisController.php +++ b/src/Controller/TypeSuivisController.php @@ -41,7 +41,7 @@ class TypeSuivisController extends AppController return false; */ - return $this->isAuthorizedCommons(); + return $this->isAuthorizedCommons($user); } diff --git a/src/Controller/UnitesController.php b/src/Controller/UnitesController.php index 98bee05..e5adc14 100644 --- a/src/Controller/UnitesController.php +++ b/src/Controller/UnitesController.php @@ -40,7 +40,7 @@ class UnitesController extends AppController return false; */ - return $this->isAuthorizedCommons(); + return $this->isAuthorizedCommons($user); } diff --git a/src/Model/Table/LdapConnectionsTable.php b/src/Model/Table/LdapConnectionsTable.php index dffcd4a..743ed46 100755 --- a/src/Model/Table/LdapConnectionsTable.php +++ b/src/Model/Table/LdapConnectionsTable.php @@ -269,8 +269,8 @@ class LdapConnectionsTable extends AppTable { // => il a donc le role "Utilisateur" PAR DEFAUT private function getTheFakeLdapUser() { return [ - 'login' => '_ldap_user_', - 'pass' => '_ldap_user_pass', + 'login' => '_fake_ldap_user_', + 'pass' => '_fake_ldap_user_pass', ]; } public function ldapAuthentication($login, $password) { diff --git a/tests/TestCase/Controller/General.php b/tests/TestCase/Controller/General.php index ea5464b..d2fb387 100644 --- a/tests/TestCase/Controller/General.php +++ b/tests/TestCase/Controller/General.php @@ -320,7 +320,7 @@ class General extends IntegrationTestCase { } public function authUtilisateurFromLdap() { //$this->authUser('_NouvelUtilisateur_username', 'NOUVEL', 'UTILISATEUR'); - $this->authUser('_ldap_user_', 'FAKE_LDAP', 'UTILISATEUR'); + $this->authUser('_fake_ldap_user_', 'FAKE_LDAP', 'UTILISATEUR'); } /* $user = [ -- libgit2 0.21.2