diff --git a/rbac/AuthorizerQueryBehavior.php b/rbac/AuthorizerQueryBehavior.php
index <HASH>..<HASH> 100644
--- a/rbac/AuthorizerQueryBehavior.php
+++ b/rbac/AuthorizerQueryBehavior.php
@@ -72,7 +72,10 @@ class AuthorizerQueryBehavior extends Behavior
         }
 
         $query = new Query;
-        $tableSchema = $model->getTableSchema();
+
+        if ($user === null) {
+            return $query->andWhere('1=0');
+        }
 
         if ($primaryKey === null) {
             $pkExpression = $this->quoteColumn('t', $model::primaryKey(), $model->getDb()->getSchema());
add a false condition to authorized() query when current user is not logged in