I created a patch to the Organic Groups module to add the "administer audience" permission. The patch can be found here, http://drupal.org/node/1211974
Here's the patch inline,
diff --git og.module og.module
index 38cc452..0206115 100644
--- og.module
+++ og.module
@@ -558,7 +558,7 @@
* Implementation of hook_perm().
*/
function og_perm() {
- return array('administer organic groups');
+ return array('administer organic groups', 'administer audience');
}
/**
@@ -1833,7 +1833,7 @@
}
$node = $form['#node'];
- $required = variable_get('og_audience_required', 0) && !user_access('administer nodes');
+ $required = variable_get('og_audience_required', 0) && !user_access('administer nodes') && !user_access('administer audience');
$is_optgroup = FALSE;
// Determine the list of groups that are shown.
@@ -1843,7 +1843,7 @@
foreach ($subs as $key => $val) {
$options[$key] = $val['title'];
}
- if (user_access('administer nodes')) {
+ if (user_access('administer nodes') || user_access('administer audience')) {
// Node admins see all of groups.
$all = og_all_groups_options();
$other = array_diff_assoc($all, $options);
@@ -1900,7 +1900,7 @@
elseif (!empty($gids)) {
// populate field from the querystring if sent
$groups = $gids;
- if (!user_access('administer nodes') && $simple) {
+ if ((!user_access('administer nodes') && !user_access('administer audience')) && $simple) {
// filter out any groups where author is not a member. we cannot rely on fapi to do this when in simple mode.
$groups = array_intersect($gids, array_keys($options));
}
@@ -1949,7 +1949,7 @@
// show multi-select. if less than 20 choices, use checkboxes.
$type = $cnt >= 20 || $is_optgroup ? 'select' : 'checkboxes';
$max_groups = variable_get('og_max_groups_'.$node->type,'');
- $description_max_groups = ($max_groups && !user_access('administer nodes')) ? format_plural($max_groups," Limited to !max_groups choice."," Limited to !max_groups choices.", array('!max_groups' => $max_groups)):'';
+ $description_max_groups = ($max_groups && !user_access('administer nodes') && !user_access('administer audience')) ? format_plural($max_groups," Limited to !max_groups choice."," Limited to !max_groups choices.", array('!max_groups' => $max_groups)):'';
$form['og_nodeapi']['visible']['og_groups'] = array(
'#type' => $type,
'#title' => t('Audience'),