#91817 by webchick and Jaza. Authors should always be ble to view thier own posts.
parent
a08f711b3f
commit
c56c5b4179
modules/node
|
@ -2582,6 +2582,8 @@ function node_search_validate($form_id, $form_values, $form) {
|
||||||
* TRUE if the operation may be performed.
|
* TRUE if the operation may be performed.
|
||||||
*/
|
*/
|
||||||
function node_access($op, $node = NULL) {
|
function node_access($op, $node = NULL) {
|
||||||
|
global $user;
|
||||||
|
|
||||||
// Convert the node to an object if necessary:
|
// Convert the node to an object if necessary:
|
||||||
if ($op != 'create') {
|
if ($op != 'create') {
|
||||||
$node = (object)$node;
|
$node = (object)$node;
|
||||||
|
@ -2629,6 +2631,12 @@ function node_access($op, $node = NULL) {
|
||||||
$result = db_query($sql, $node->nid);
|
$result = db_query($sql, $node->nid);
|
||||||
return (db_result($result));
|
return (db_result($result));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Let authors view their own nodes.
|
||||||
|
if ($op == 'view' && $user->uid == $node->uid && $user->uid != 0) {
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue