Return booleans.
authorJan Schneider <jan@horde.org>
Wed, 22 Dec 2010 11:02:43 +0000 (12:02 +0100)
committerJan Schneider <jan@horde.org>
Wed, 22 Dec 2010 13:58:11 +0000 (14:58 +0100)
framework/Perms/lib/Horde/Perms.php

index 0aad5b7..d8ea366 100644 (file)
@@ -423,7 +423,7 @@ class Horde_Perms
      */
     public function hasPermission($permission, $user, $perm, $creator = null)
     {
-        return ($this->getPermissions($permission, $user, $creator) & $perm);
+        return (bool)($this->getPermissions($permission, $user, $creator) & $perm);
     }
 
     /**
@@ -460,7 +460,7 @@ class Horde_Perms
             );
 
             try {
-                return $GLOBALS['registry']->callAppMethod($app, 'hasPermission', array('args' => $args));
+                return (bool)$GLOBALS['registry']->callAppMethod($app, 'hasPermission', array('args' => $args));
             } catch (Horde_Exception $e) {}
         }