| 1 |
<?php |
<?php |
|
// $Id$ |
|
|
// Copyright Khalid Baheyeldin 2006-2009 http://2bits.com |
|
| 2 |
|
|
| 3 |
define('JOB_PERM_VIEW', 'view jobs'); |
define('JOB_PERM_VIEW', 'view jobs'); |
| 4 |
|
|
|
/** |
|
|
* Implementation of hook_node_grants(). |
|
|
*/ |
|
| 5 |
function job_access_node_grants($account, $op) { |
function job_access_node_grants($account, $op) { |
| 6 |
$grants = array(); |
$grants = array(); |
| 7 |
if ($op == 'view' && user_access(JOB_PERM_VIEW, $account)) { |
if ($op == 'view' && user_access(JOB_PERM_VIEW, $account)) { |
| 10 |
return $grants; |
return $grants; |
| 11 |
} |
} |
| 12 |
|
|
|
/** |
|
|
* Implementation of hook_node_access_records(). |
|
|
*/ |
|
| 13 |
function job_access_node_access_records($node) { |
function job_access_node_access_records($node) { |
| 14 |
$grants = array(); |
$grants = array(); |
| 15 |
if (variable_get(JOB_NODE_TYPE . $node->type, 0)) { |
if (variable_get(JOB_NODE_TYPE . $node->type, 0)) { |
| 25 |
return $grants; |
return $grants; |
| 26 |
} |
} |
| 27 |
|
|
|
/** |
|
|
* Implementation of hook_perm(). |
|
|
*/ |
|
| 28 |
function job_access_perm() { |
function job_access_perm() { |
| 29 |
return array( |
return array( |
| 30 |
JOB_PERM_VIEW, |
JOB_PERM_VIEW, |