From 8f558ba0ed7b61c2991349d60166e6260cbb3903 Mon Sep 17 00:00:00 2001
From: Patrick Coffey <patrickcoffey48@gmail.com>
Date: Thu, 6 Aug 2015 14:16:15 -0500
Subject: [PATCH] Fix user and role access application logic

---
 workbench_access.module | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/workbench_access.module b/workbench_access.module
index 3cc3130..ddba6eb 100644
--- a/workbench_access.module
+++ b/workbench_access.module
@@ -819,8 +819,8 @@ function workbench_access_user_load_data($account) {
       ->condition('war.access_scheme', $access_scheme);
     $result = $query->execute()->fetchAll();
     foreach ($result as $data) {
-      // If the role is set it matches a role the user has
-      if (isset($items[$data->access_id])) {
+      // If the user doesn't have access, add access by their role.
+      if (!isset($items[$data->access_id])) {
         $items[$data->access_id] = $data;
         // Identify the access-by-role features.
         $account->workbench_access_by_role[] = $data->access_id;
-- 
2.3.2 (Apple Git-55)

