You are here

function og_webform_webform_results_clear_access in Organic Groups Webform Integration 7

Same name and namespace in other branches
  1. 6 og_webform.module \og_webform_webform_results_clear_access()

Implements hook_webform_results_clear_access().

File

./og_webform.module, line 136
Enables organic group administrators to modify webforms within their groups.

Code

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);
    }
  }
}