How does one limit "what" can access a page. I understand how to use
hook_permission() to set user permission based on a role to control access to
hook_menu() items. However, what if I have a
hook_menu() item that is to be used solely by the system itself? For example, say I have a registration page in a custom module:
module/register - Anyone can access that page. Then, say I have an ajax call that is to be made when the user performs some action on the page. So, I register another item in
hook_menu(), call it
module/register/ajax - I do not want anyone to be able to browse to
module/register/ajax but I want to be able to do an ajax call to that page. What is the best way to accomplish this?