diff --git a/og_webform.module b/og_webform.module
index 3437454..2b717c3 100644
--- a/og_webform.module
+++ b/og_webform.module
@@ -60,29 +60,46 @@ function og_webform_webform_submission_access($node, $submission, $op = 'view',
   if (empty($node->vid) && !empty($node->nid)) {
     $node = node_load($node->nid);
   }
-
-  // If this webform is not in a group, don't affect access.
-  if (empty($node->group_audience['und'])) {
-    return;
-  }
-
+  
   $access_all = FALSE;
   $access_own_submission = FALSE;
-  foreach ($node->group_audience['und'] as $group) {
-    // Determine if the user has access to all results and submissions.
-    if (og_user_access($group['gid'], 'access all webform results', $account)) {
-      $access_all = TRUE;
-      break; // If we access to everything, "access own" doesn't matter.
-    }
-
-    // Or check if they have access to just their own submissions.
-    if (isset($submission) && og_user_access($group['gid'], 'access own webform submissions', $account) && (($account->uid && $account->uid == $submission->uid) || isset($_SESSION['webform_submission'][$submission->sid]))) {
-      $access_own_submission = TRUE;
+  $edit_submission = FALSE;
+  $delete_submission = FALSE;
+  $general_access = FALSE;
+  if (og_is_group_content_type('node', $node->type) && $groups = og_get_entity_groups('node', $node)) {
+    foreach ($groups as $group_type => $gids) {
+      foreach ($gids as $gid) {
+        // Only need access in one of the associated groups.
+        if (!$access_all) {
+          // Determine if the user has access to all results and submissions.
+          if (og_user_access($group_type, $gid, 'access all webform results', $account)) {
+            $access_all = TRUE;
+          }
+          // Or check if they have access to just their own submissions.
+          elseif (isset($submission) && og_user_access($group_type, $gid, 'access own webform submissions', $account) && (($account->uid && $account->uid == $submission->uid) || isset($_SESSION['webform_submission'][$submission->sid]))) {
+            $access_own_submission = TRUE;
+          }
+        }
+        // Access to any operation (view/edit/delete) requires access permission.
+        $general_access = $access_all || $access_own_submission;
+				
+        if (!$edit_submission && $general_access && $op == 'edit') {
+          if (og_user_access($group_type, $gid, 'edit all webform submissions', $account) || (og_user_access($group_type, $gid, 'edit own webform submissions', $account) && $submission->uid == $account->uid)) {
+            $edit_submission = TRUE;
+          }
+        }
+        if (!$delete_submission && $general_access && $op == 'delete') {
+          if (og_user_access($group_type, $gid, 'delete all webform submissions', $account) || (og_user_access($group_type, $gid, 'delete own webform submissions', $account) && $submission->uid == $account->uid)) {
+            $delete_submission = TRUE;
+          }
+        }
+      }
     }
   }
-
-  // Access to any operation (view/edit/delete) requires access permission.
-  $general_access = $access_all || $access_own_submission;
+  else {
+    // If this webform is not in a group, don't affect access.
+    return;
+  }
 
   switch ($op) {
     case 'view':
@@ -90,27 +107,13 @@ function og_webform_webform_submission_access($node, $submission, $op = 'view',
     case 'save':
       // The "save" case tells Webform to save a session for anonymous users if
       // they have permission to access their own permissions.
-      return og_user_access($group['gid'], 'access own webform submissions', $account);
+      return $access_own_submission;
     case 'list':
-      return og_user_access($group['gid'], 'access all webform results', $account) || (og_user_access($group['gid'], 'access own webform submissions', $account) && ($account->uid || isset($_SESSION['webform_submission'])));
+      return $general_access && ($account->uid || isset($_SESSION['webform_submission']));
     case 'edit':
-      if ($general_access) {
-        foreach ($node->group_audience['und'] as $group) {
-          if (og_user_access($group['gid'], 'edit all webform submissions', $account) || (og_user_access($group['gid'], 'edit own webform submissions', $account) && $submission->uid == $account->uid)) {
-            return TRUE;
-          }
-        }
-      }
-      break;
+      return $edit_submission;
     case 'delete':
-      if ($general_access) {
-        foreach ($node->group_audience['und'] as $group) {
-          if (og_user_access($group['gid'], 'delete all webform submissions', $account) || (og_user_access($group['gid'], 'delete own webform submissions', $account) && $submission->uid == $account->uid)) {
-            return TRUE;
-          }
-        }
-      }
-      break;
+      return $delete_submission;
   }
 }
 
@@ -118,29 +121,36 @@ function og_webform_webform_submission_access($node, $submission, $op = 'view',
  * Implements hook_webform_results_access().
  */
 function og_webform_webform_results_access($node, $account = NULL) {
-  // If this webform is not in a group, don't affect access.
-  if (empty($node->group_audience['und'])) {
-    return;
-  }
-
-  foreach ($node->group_audience['und'] as $group) {
-    if (og_user_access($group['gid'], 'access all webform results', $account)) {
-      return TRUE;
-    }
-  }
+  if (og_is_group_content_type('node', $node->type) && $groups = og_get_entity_groups('node', $node)) {
+    foreach ($groups as $group_type => $gids) {
+      foreach ($gids as $gid) {
+        if (og_user_access($group_type, $gid, 'access all webform results', $account)) {
+          return TRUE;
+        }
+      }
+    }
+  }
+  else {
+    // If this webform is not in a group, don't affect access.
+    return;
+  }
 }
 
 /**
  * Implements hook_webform_results_clear_access().
  */
 function og_webform_webform_results_clear_access($node, $account = NULL) {
-  if (empty($node->group_audience['und'])) {
-    return;
-  }
-
-  foreach ($node->group_audience['und'] as $group) {
-    if (og_user_access($group['gid'], 'delete all webform submissions', $account)) {
-      return og_webform_webform_results_access($node, $account);
-    }
-  }
+  if (og_is_group_content_type('node', $node->type) && $groups = og_get_entity_groups('node', $node)) {
+    foreach ($groups as $group_type => $gids) {
+      foreach ($gids as $gid) {
+        if (og_user_access($group_type, $gid, 'delete all webform submissions', $account)) {
+          return og_webform_webform_results_access($node, $account);
+        }
+      }
+    }
+  }
+  else {
+    // If this webform is not in a group, don't affect access.
+    return;
+  }
 }
