[icinga-checkins] icinga.org: icingaweb2/feature/actiontable-row-handling-13115: Revert " Make hooks respect module permissions"

git at icinga.org git at icinga.org
Wed Nov 16 10:39:05 CET 2016


Module: icingaweb2
Branch: feature/actiontable-row-handling-13115
Commit: 1cd2cfbdc944901b9379bbd1e1d53f8dbafc46fa
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=1cd2cfbdc944901b9379bbd1e1d53f8dbafc46fa

Author: Alexander A. Klimov <alexander.klimov at icinga.com>
Date:   Thu Oct 20 18:28:19 2016 +0200

Revert "Make hooks respect module permissions"

This reverts commit 4d2e6d2d8709da9168af824c36458dd5857b08a8.

---

 library/Icinga/Application/Modules/Module.php |   24 ++++++++++--------------
 1 file changed, 10 insertions(+), 14 deletions(-)

diff --git a/library/Icinga/Application/Modules/Module.php b/library/Icinga/Application/Modules/Module.php
index 5551272..de40266 100644
--- a/library/Icinga/Application/Modules/Module.php
+++ b/library/Icinga/Application/Modules/Module.php
@@ -4,7 +4,6 @@
 namespace Icinga\Application\Modules;
 
 use Exception;
-use Icinga\Authentication\Auth;
 use Zend_Controller_Router_Route;
 use Zend_Controller_Router_Route_Abstract;
 use Zend_Controller_Router_Route_Regex;
@@ -1283,22 +1282,19 @@ class Module
      */
     protected function provideHook($name, $implementation = null, $key = null)
     {
-        if (Auth::getInstance()->hasPermission('module/' . $this->name)) {
-            if ($implementation === null) {
-                $implementation = $name;
-            }
-
-            if (strpos($implementation, '\\') === false) {
-                $class = $this->getNamespace()
-                    . '\\ProvidedHook\\'
-                    . $this->slashesToNamespace($implementation);
-            } else {
-                $class = $implementation;
-            }
+        if ($implementation === null) {
+            $implementation = $name;
+        }
 
-            Hook::register($name, $class, $class);
+        if (strpos($implementation, '\\') === false) {
+            $class = $this->getNamespace()
+                   . '\\ProvidedHook\\'
+                   . $this->slashesToNamespace($implementation);
+        } else {
+            $class = $implementation;
         }
 
+        Hook::register($name, $class, $class);
         return $this;
     }
 



More information about the icinga-checkins mailing list