domain_views_get_grants

Versions
domain
domain_views_get_grants($account = NULL)

Helper function to return the node grants for this user.

Parameters

$account The account object of the user requesting the View.

Return value

$grants An array indicating which domains the user may access.

Code

domain_views/domain_views.module, line 121

<?php
function domain_views_get_grants($account = NULL)  {
  global $user, $_domain;
  static $grants;
  if (empty($account)) {
    $account = $user;
  }
  if (isset($grants[$account->uid])) {
    return $grants[$account->uid];
  }
  $user_grants = domain_node_grants($account, 'view');
  // Domain All gets in the way of normal grants.
  if (!empty($user_grants['domain_all'])) {
    $user_grants['domain_id'] = array($_domain['domain_id']);
    _domain_views_alter_grants($user_grants);
  }
  $grants[$account->uid] = $user_grants;
  return $grants[$account->uid];
}
?>

Contact

  • agentrickard [at] gmail [dot] com

Donations

My Amazon.com Wish List