You are here

function gallery_assist_check_ur in Gallery Assist 6

2 calls to gallery_assist_check_ur()
gallery_assist_check_access in ./gallery_assist.module
_gallery_assist_block_display_2 in ./gallery_assist.module
Display the GA-Block Gallery Block (2).

File

./gallery_assist.module, line 2058
Drupal content type with gallery functionality.

Code

function gallery_assist_check_ur($node, $op) {
  global $user;
  if ($user->uid == 1) {
    return TRUE;
  }
  $users = array(
    "between" => array(
      $node->uid,
      $user->uid,
    ),
  );
  $get_rel = user_relationships_load($users);
  $grant = 0;
  foreach ($get_rel as $rel) {
    $grant = $grant + $node->user_relationship_node_access[$rel->rtid][$op];
  }
  if ($grant > 0) {
    return TRUE;
  }
  else {
    return FALSE;
  }
}