[icinga-checkins] icinga.org: icingaweb2/feature/security-gui-5647: Security: Remove getPermissions and getRestrictions from the AdmissionLoader

git at icinga.org git at icinga.org
Wed Nov 19 15:23:57 CET 2014


Module: icingaweb2
Branch: feature/security-gui-5647
Commit: 3e1583ca406b76fc7e1e541434cd99ebac49e5f5
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=3e1583ca406b76fc7e1e541434cd99ebac49e5f5

Author: Eric Lippmann <eric.lippmann at netways.de>
Date:   Wed Nov 19 15:13:45 2014 +0100

Security: Remove getPermissions and getRestrictions from the AdmissionLoader

These funtctions are superseded by getRestrictionsAndPermissions.

refs #5647

---

 library/Icinga/Authentication/AdmissionLoader.php |   70 ---------------------
 1 file changed, 70 deletions(-)

diff --git a/library/Icinga/Authentication/AdmissionLoader.php b/library/Icinga/Authentication/AdmissionLoader.php
index 4a65d15..d97fc53 100644
--- a/library/Icinga/Authentication/AdmissionLoader.php
+++ b/library/Icinga/Authentication/AdmissionLoader.php
@@ -86,74 +86,4 @@ class AdmissionLoader
         }
         return array($permissions, $restrictions);
     }
-
-    /**
-     * Get user permissions
-     *
-     * @param   User  $user
-     *
-     * @return  array
-     */
-    public function getPermissions(User $user)
-    {
-        $permissions = array();
-        try {
-            $config = Config::app('permissions');
-        } catch (NotReadableError $e) {
-            Logger::error(
-                'Can\'t get permissions for user \'%s\'. An exception was thrown:',
-                $user->getUsername(),
-                $e
-            );
-            return $permissions;
-        }
-        $username = $user->getUsername();
-        $userGroups = $user->getGroups();
-        foreach ($config as $section) {
-            if (! empty($section->permissions)
-                && $this->match($username, $userGroups, $section)
-            ) {
-                $permissions = array_merge(
-                    $permissions,
-                    array_diff(String::trimSplit($section->permissions), $permissions)
-                );
-            }
-        }
-        return $permissions;
-    }
-
-    /**
-     * Get user restrictions
-     *
-     * @param   User  $user
-     *
-     * @return  array
-     */
-    public function getRestrictions(User $user)
-    {
-        $restrictions = array();
-        try {
-            $config = Config::app('restrictions');
-        } catch (NotReadableError $e) {
-            Logger::error(
-                'Can\'t get restrictions for user \'%s\'. An exception was thrown:',
-                $user->getUsername(),
-                $e
-            );
-            return $restrictions;
-        }
-        $username = $user->getUsername();
-        $userGroups = $user->getGroups();
-        foreach ($config as $section) {
-            if (! empty($section->restriction)
-                && $this->match($username, $userGroups, $section)
-            ) {
-                $restrictions = array_merge(
-                    $restrictions,
-                    array_diff(String::trimSplit($section->restriction), $restrictions)
-                );
-            }
-        }
-        return $restrictions;
-    }
 }



More information about the icinga-checkins mailing list