You are here

function og_is_group_admin in Organic groups 6.2

Same name and namespace in other branches
  1. 6 og.module \og_is_group_admin()

Determine whether user can act as a group administrator for a given group.

Parameters

string $node: Node object of the group.

string $account: A user account object. If not supplied, the current user is assumed.

Return value

boolean

8 calls to og_is_group_admin()
og_broadcast_access in ./og.module
Access callback to use group broadcast.
og_menu_access_invite in ./og.module
Menu access callback to determine if the current user may invite other users.
og_menu_access_node_edit in ./og.module
Menu access callback used to override node edit access for group admins.
og_menu_access_unsubscribe in ./og.module
Check if current user may unsubscribe the specified user from the specified group.
og_subscribe in ./og.pages.inc

... See full list

1 string reference to 'og_is_group_admin'
og_menu in ./og.module
Implementation of hook_menu().

File

./og.module, line 441
Code for the Organic Groups module.

Code

function og_is_group_admin($node, $account = NULL) {
  if (empty($account)) {
    global $user;
    $account = drupal_clone($user);
  }

  // Modules can cause us to arrive here before og_init() has fired.
  // See http://drupal.org/node/285696
  if ($account->uid && !isset($account->og_groups)) {

    // Reload the user object.
    $account = user_load($account->uid);
  }
  return og_is_group_type($node->type) && (user_access('administer nodes', $account) || !empty($account->og_groups[$node->nid]['is_admin']));
}