You are here

function tft_og_tft_term_access in Taxonomy File Tree 7.2

Implements hook_tft_term_access().

File

modules/tft_og/tft_og.module, line 61
Hook implementations for TFT OG.

Code

function tft_og_tft_term_access($tid, $account = NULL, $op = 'view') {
  if (!isset($account)) {
    global $user;
    $account = $user;
  }
  if ($og_nid = tft_og_get_og_nid($tid)) {
    if ($op === 'view') {
      return og_user_access('node', $og_nid, TFT_PERM__ACCESS_FULL_TREE, $account);
    }
    elseif ($op == 'delete') {
      return og_user_access('node', $og_nid, TFT_PERM__DELETE_TERMS, $account);
    }
    elseif ($op == 'add-file') {
      return og_user_access('node', $og_nid, TFT_PERM__ADD_FILE, $account);
    }
    elseif ($op == 'add-folder' || $op == 'edit') {
      return og_user_access('node', $og_nid, TFT_PERM__ADD_TERMS, $account);
    }
    elseif ($op == 'reorder') {
      return og_user_access('node', $og_nid, TFT_PERM__REORDER_ITEMS, $account);
    }
  }
}