Why is hook_node_access($node, $op, $account) called with $op equal to "create"? I am using the function mymodule_node_access($node, $op, $account) to intercept the operation of creating a new node type "article" by the user Advertiser.


I created a new user "Advertiser"
The new user "Advertiser" has all permissions enabled on the node type "article"
The user "Advertiser" can use the admin bar
I created a custom module to control access to the node by the user "Advertiser"
In mymodule_node_access($node, $op, $account), I displays the values ​​of $node and $op 


When the user logs into the system, the function mymodule_node_access($node, $op, $account) displays:


  Type of node: article Operation: create


Why does that happen?

The user "Advetiser" has not yet created a new node type article.

Besides, if I disable the use of the admin bar by the user "Advertiser", the situation does not occur.

How can I fix?
The admin menu contains links to create new content, and menu items also go through an access check to make sure the current user has access to the path. If they don't, the menu item is hidden.

The access callback for the path node/add/* is node_access(), which invokes hook_node_access(), which is why your access hook is being invoked when the admin menu is present.

You can either remove the admin menu altogether, or remove the links to create new content from it and your hook won't be invoked any more.