You are here

function og_menu_access_node_edit in Organic groups 6

Same name and namespace in other branches
  1. 6.2 og.module \og_menu_access_node_edit()
1 string reference to 'og_menu_access_node_edit'
og_menu_alter in ./og.module

File

./og.module, line 176

Code

function og_menu_access_node_edit($node) {

  // Am I a group admin for this group post?
  if (!module_exists('og_access') && isset($node->og_groups)) {
    foreach ($node->og_groups as $gid) {
      if (og_is_group_admin(node_load($gid))) {
        return TRUE;
      }
    }
  }

  // Am I group admin for this group node?
  if (!module_exists('og_access') && og_is_group_admin($node)) {
    return TRUE;
  }

  // Since the group admin tests failed, check access as usual.
  return node_access('update', $node);
}