diff --git a/includes/context.inc b/includes/context.inc
index c8492b7123e69db9c1ea6c6dc3036c4a8d81e4cb..9f1bbc30d154d62af66e55530cb2f6394a160e8e 100644
--- a/includes/context.inc
+++ b/includes/context.inc
@@ -1309,14 +1309,18 @@ function ctools_access($settings, $contexts = array()) {
     }
 
     if ($pass && $settings['logic'] == 'or') {
+      // Pass if 'or' and this rule passed.
       return TRUE;
     }
     else if (!$pass && $settings['logic'] == 'and') {
+      // Fail if 'and' and htis rule failed.
       return FALSE;
     }
   }
 
-  return TRUE;
+  // Return TRUE if logic was and, meaning all rules passed.
+  // Return FALSE if logic was or, meaning no rule passed.
+  return $settings['logic'] == 'and';
 }
 
 /**