You are here

function _homebox_og_user_access_view_homebox in Homebox 6.3

Same name and namespace in other branches
  1. 6.2 homebox_og/homebox_og.module \_homebox_og_user_access_view_homebox()
  2. 7.2 homebox_og/homebox_og.module \_homebox_og_user_access_view_homebox()

Determine if a user can access the Homebox

1 string reference to '_homebox_og_user_access_view_homebox'
homebox_og_menu in homebox_og/homebox_og.module

File

homebox_og/homebox_og.module, line 96
Organic Groups integration for Homebox

Code

function _homebox_og_user_access_view_homebox($page, $node) {

  // If this a group node?
  // Can the user access the node?
  // Can the user view the Homebox?
  if (og_is_group_type($node->type) && node_access('view', $node) && _homebox_user_access_view_homebox($page)) {

    // Check if the group tab is set to members only
    if (variable_get('homebox_og_tab_membersonly', 0)) {
      if (og_is_group_member($node->nid)) {
        return TRUE;
      }
      else {
        return FALSE;
      }
    }
    return TRUE;
  }
  else {
    return FALSE;
  }
}