How do I set permission for a custom page to be based on node access? I have added pages using hook_menu like so:

function dynamic_entries_menu() {
    $items = array();
    $items['entries/get'] = array(
            'title' =&gt; 'Dynamic Entries',
            'page callback' =&gt; 'dynamic_entries_get_entry',
            'type' =&gt; MENU_CALLBACK
    );
    return $items;
}


A node ID is added to the end of the URL. For example, /entries/get/10. I want to allow access to this page to anyone who has access to the requested node. How do I do that?
Use entries/get/%node as path and node_access() as access callback. Also, you might want to consider setting page arguments. It's not a good idea for the page callback to fetch the node id from the URL or using the  arg() function.

$items['entries/get/%node'] = array(
  'title' =&gt; 'Dynamic Entries',
  'page callback' =&gt; 'dynamic_entries_get_entry',
  'page arguments' =&gt; array(2),
  'access callback' =&gt; 'node_access',
  'access arguments' =&gt; array('view', 2),
  'type' =&gt; MENU_CALLBACK,
);


BTW the function node_menu() is the hook_menu implementation of the node module. Looking up how the Drupal core modules implement certain hooks often helps.