hook_menu to change menu button item by checking group membership
Here is a sample code close enough to your question. It may need some modifications to its parts in order to meet your needs, but more or less you got the idea.

/**
 * Implements hook_menu_alter().
 */
function foo_menu_alter(&amp;$items) {
  $items['alter/%gid/path']['access callback'] = 'og_user_role_callback';
  $items['alter/%gid/path']['access arguments'] = array(1);
}

/**
 * Determine if logged-in user has access to menu or not.
 */
function og_user_role_callback($gid) {

  // Get OG role of the user. Could be 'member', 'non-member' or 'Group administrator'.
  global $user;
  $group_type = 'node';
  $uid = $user-&gt;uid;
  $member = og_get_user_roles($group_type, $gid, $uid, $include = TRUE);

  switch ($member) {
    case 'member':
      return TRUE;
    case 'non-member':
      return FALSE;
    case 'Group administrator':
      return TRUE;
  }
}