1 node.module node_preview_access($node_tempstore_id)

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

@since 1.12.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

core/modules/node/node.module, line 1898
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;
}