summaryrefslogtreecommitdiff
path: root/modules/node/node.api.php
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-02-05 22:24:12 +0000
committerDries Buytaert <dries@buytaert.net>2010-02-05 22:24:12 +0000
commit20fc2119d7a16da0b1cac7320233fbd424b36f92 (patch)
tree4495223031a47aa5ddb19c95a9bf78cabf8e1047 /modules/node/node.api.php
parentd48a6deacb459f5315eb48628876601476986de8 (diff)
downloadbrdo-20fc2119d7a16da0b1cac7320233fbd424b36f92.tar.gz
brdo-20fc2119d7a16da0b1cac7320233fbd424b36f92.tar.bz2
- Patch #704728 by jhodgdon: fixed node grants documentation.
Diffstat (limited to 'modules/node/node.api.php')
-rw-r--r--modules/node/node.api.php23
1 files changed, 13 insertions, 10 deletions
diff --git a/modules/node/node.api.php b/modules/node/node.api.php
index e2671f097..51fe9037f 100644
--- a/modules/node/node.api.php
+++ b/modules/node/node.api.php
@@ -57,15 +57,18 @@ function hook_node_grants($account, $op) {
* interested, it must respond with an array of permissions arrays for that
* node.
*
+ * Note that the grant values in the return value from your hook must be
+ * integers and not boolean TRUE and FALSE.
+ *
* Each permissions item in the array is an array with the following elements:
* - 'realm': The name of a realm that the module has defined in
* hook_node_grants().
* - 'gid': A 'grant ID' from hook_node_grants().
- * - 'grant_view': If set to TRUE a user that has been identified as a member
+ * - 'grant_view': If set to 1 a user that has been identified as a member
* of this gid within this realm can view this node.
- * - 'grant_update': If set to TRUE a user that has been identified as a member
+ * - 'grant_update': If set to 1 a user that has been identified as a member
* of this gid within this realm can edit this node.
- * - 'grant_delete': If set to TRUE a user that has been identified as a member
+ * - 'grant_delete': If set to 1 a user that has been identified as a member
* of this gid within this realm can delete this node.
* - 'priority': If multiple modules seek to set permissions on a node, the
* realms that have the highest priority will win out, and realms with a lower
@@ -85,10 +88,10 @@ function hook_node_access_records($node) {
$grants = array();
$grants[] = array(
'realm' => 'example',
- 'gid' => TRUE,
- 'grant_view' => TRUE,
- 'grant_update' => FALSE,
- 'grant_delete' => FALSE,
+ 'gid' => 1,
+ 'grant_view' => 1,
+ 'grant_update' => 0,
+ 'grant_delete' => 0,
'priority' => 0,
);
@@ -97,9 +100,9 @@ function hook_node_access_records($node) {
$grants[] = array(
'realm' => 'example_author',
'gid' => $node->uid,
- 'grant_view' => TRUE,
- 'grant_update' => TRUE,
- 'grant_delete' => TRUE,
+ 'grant_view' => 1,
+ 'grant_update' => 1,
+ 'grant_delete' => 1,
'priority' => 0,
);
return $grants;