1.20.x node.module node_preview_access($node_tempstore_id)

Access callback: Checks a user's permission for previewing a node.

@since 1.13.0

Parameters

$node_tempstore_id: The node_tempstore_id of the node being created or updated.

Return value

bool: TRUE if the user has access to the preview, FALSE otherwise.

See also

node_menu()

File

modules/node/node.module, line 2001
The core module that allows content to be submitted to the site.

Code

function node_preview_access($node_tempstore_id) {
  $node = node_get_node_tempstore($node_tempstore_id);
  if (!empty($node) && (node_access('create', $node) || node_access('update', $node))) {
    return TRUE;
  }
  return FALSE;
}