You are here

function anonymous_publishing_node_grants in Anonymous Publishing 5

Implementation of hook_node_grants().

Tell the node access system what GIDs the user belongs to for each realm.

File

./anonymous_publishing.module, line 310
Installation file for the anonymous_publishing module.

Code

function anonymous_publishing_node_grants($account, $op) {
  $grants['anonymous_publishing'] = array(
    0,
  );
  $akey = isset($_GET['akey']) ? $_GET['akey'] : arg(3);
  if (!empty($akey)) {
    if (db_result(db_query("SELECT nid FROM {anonymous_publishing} WHERE akey = '%s'", $akey))) {
      $grants['anonymous_publishing'] = array(
        1,
      );
    }
  }
  return $grants;
}