Author only access to tab menu of node I have created one menu tab in the node page to show statistics  of the article using my custom module.

I have implemented hook_menu() as follows:

function mymodule_menu() {

    $items = array();

    $items['node/%node/menu_title'] = array(
        'title' =&gt; 'Page Title',
        'page callback' =&gt; 'get_statstics',
        'page arguments' =&gt; array(1),
        'access callback' =&gt; TRUE,
        'type' =&gt; MENU_LOCAL_TASK,
    );

    return $items;
}


It is working fine. But I wanted only author of the node to have access to this link and also for specific content type. Now it is showing this link to every node and for every user. 

How can I restrict it to specific content type and for author only?

-- Many thanks for your time
Under access callback you have TRUE, just change this to a function that evaluates whether the current user is the author of the current node. The function would look like this

function yourmodule_check_author() {
  global $user;
  $node = menu_get_object();
  return $node-&gt;uid == $user-&gt;uid;
}


Check this post. You will get more insight on the inner workings of the function.