diff --git a/workbench_access.module b/workbench_access.module
index d78fa36..2923659 100644
--- a/workbench_access.module
+++ b/workbench_access.module
@@ -1730,3 +1730,45 @@ function workbench_access_access_scheme_load($scheme) {
   $info = module_invoke_all('workbench_access_info');
   return isset($info[$scheme]) ? $info[$scheme] : FALSE;
 }
+
+/**
+ * Return an array of users who have permission to edit a section.
+ *
+ * @param $access_type
+ *   The type of access requested (e.g.g taxonomy).
+ * @param $access_type_id
+ *   The id for this specific access (here, a taxonomy term tid).
+ * @param $rid
+ *   A role ID or an array of role IDs or role names. If this parameter is supplied, 
+ *   restrict the results to users with the specified roles.
+ */
+function workbench_access_users($access_type, $access_type_id, $rid=NULL) {
+  if (!$rid) {
+    $roles = array_keys(workbench_access_get_roles('access workbench access by role'));
+  }
+  else if (is_array($rid)) {
+    $roles = $rid;
+  }
+  else if (is_int($rid)) {
+    $roles = array($rid);
+  }
+  else {
+    $role = user_role_load_by_name($rid);
+    $roles = array($role->rid);
+  }
+  $query = db_select('users', 'u')
+    ->fields('u', array('uid', 'name'));
+  $query->join('workbench_access_user', 'wau', 'u.uid = wau.uid');
+  $query->join('users_roles', 'ur', 'u.uid = ur.uid');
+  $query->join('role_permission', 'rp', 'rp.rid = ur.rid');
+  $query->condition('wau.access_scheme', $access_type)
+    ->condition('wau.access_id', $access_type_id)
+    ->condition('ur.rid', $roles, 'IN');
+  $result = $query->execute();
+  $users = array();
+  foreach ($result as $account) {
+    $users[$account->uid] = $account->name;
+  }
+  return $users;
+}
+
