diff --git a/library/ZendAfi/View/Helper/FonctionsAdmin.php b/library/ZendAfi/View/Helper/FonctionsAdmin.php index 8f99876bee002547a9abcdd4f61ac81ccbc6a9e6..1cc51cdb9f77122664bc779c996de5794c7abdc3 100644 --- a/library/ZendAfi/View/Helper/FonctionsAdmin.php +++ b/library/ZendAfi/View/Helper/FonctionsAdmin.php @@ -37,14 +37,12 @@ class ZendAfi_View_Helper_FonctionsAdmin extends ZendAfi_View_Helper_BaseHelper $actions = [$this->_extended($extended_actions)]; - if (!Class_Users::isCurrentUserAllowedToEditProfile($profile)) - return ''; - - $actions = array_merge($actions, - [$this->_config(), - $this->_versions(), - $this->_add(), - $this->_delete()]); + if (Class_Users::isCurrentUserAllowedToEditProfile($profile)) + $actions = array_merge($actions, + [$this->_config(), + $this->_versions(), + $this->_add(), + $this->_delete()]); $html = trim(implode(' ', array_filter($actions))); diff --git a/tests/library/ZendAfi/View/Helper/Accueil/KiosqueTest.php b/tests/library/ZendAfi/View/Helper/Accueil/KiosqueTest.php index e1ef547edbcc43141c530bafd4ee9e4962070631..05f9dbef3a49bac11cf8f8c4f01eba54ffa9bf57 100644 --- a/tests/library/ZendAfi/View/Helper/Accueil/KiosqueTest.php +++ b/tests/library/ZendAfi/View/Helper/Accueil/KiosqueTest.php @@ -188,6 +188,13 @@ class ZendAfi_View_Helper_Accueil_KiosqueCubeAsRedacteurWithCatalogueTest extend '//a[contains(@href, "admin/catalogue/add/id_catalogue/89/id_module/3")]', $this->_html); } + + + /** @test */ + public function linkToEditWidgetShouldNotBePresent() { + $this->assertNotXPath($this->_html, + '//a[contains(@href, "/admin/widget")]'); + } } diff --git a/tests/library/ZendAfi/View/Helper/Admin/FonctionsAdminTest.php b/tests/library/ZendAfi/View/Helper/Admin/FonctionsAdminTest.php index 2696defa8be154b73b6722781cb3bf5788417664..57040b6dc8e89e91766602ef024c5e0d549fed72 100644 --- a/tests/library/ZendAfi/View/Helper/Admin/FonctionsAdminTest.php +++ b/tests/library/ZendAfi/View/Helper/Admin/FonctionsAdminTest.php @@ -58,7 +58,8 @@ class FonctionsAdminHelperTest extends ViewHelperTestCase { 'password' => 'password', 'id_site' => 1, 'role_level' => ZendAfi_Acl_AdminControllerRoles::ADMIN_BIB])); - $this->_content = $this->helper->fonctionsAdmin(0, false, null, [function() {return 'test';}]); + + $this->_content = $this->helper->fonctionsAdmin(); $this->assertEquals('', $this->_content); } } \ No newline at end of file