summaryrefslogtreecommitdiff
path: root/modules/node/node.module
diff options
context:
space:
mode:
authorNeil Drumm <drumm@3064.no-reply.drupal.org>2006-11-12 19:09:11 +0000
committerNeil Drumm <drumm@3064.no-reply.drupal.org>2006-11-12 19:09:11 +0000
commitc56c5b41793eea279aed941ad49fab3c62842976 (patch)
tree81ac7e5f948daae7ae56e9fb60d432d194508d7b /modules/node/node.module
parenta08f711b3ff0543fa59f5c04c1bea27fd33aeba2 (diff)
downloadbrdo-c56c5b41793eea279aed941ad49fab3c62842976.tar.gz
brdo-c56c5b41793eea279aed941ad49fab3c62842976.tar.bz2
#91817 by webchick and Jaza. Authors should always be ble to view thier own posts.
Diffstat (limited to 'modules/node/node.module')
-rw-r--r--modules/node/node.module8
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/node/node.module b/modules/node/node.module
index e89571f65..88ba2fb8c 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -2582,6 +2582,8 @@ function node_search_validate($form_id, $form_values, $form) {
* TRUE if the operation may be performed.
*/
function node_access($op, $node = NULL) {
+ global $user;
+
// Convert the node to an object if necessary:
if ($op != 'create') {
$node = (object)$node;
@@ -2629,6 +2631,12 @@ function node_access($op, $node = NULL) {
$result = db_query($sql, $node->nid);
return (db_result($result));
}
+
+ // Let authors view their own nodes.
+ if ($op == 'view' && $user->uid == $node->uid && $user->uid != 0) {
+ return TRUE;
+ }
+
return FALSE;
}