Programmatically Filter Node Access beyond permissions, views, etc Short Version:

What would you say is the best way to filter how nodes appear (in a binary sense: published vs. hidden) to users based off of a dynamic value?  This solution is beyond the scope of typical modules like Permissions, Views, or Content Access.

Long Version:

My application calls for having select nodes display to select users based off of values changed over time. For instance, lets say a user wants access a node but both the users and the nodes change their location (daily).  When a customer views the site (or any page) I want them to only be able to see nodes in their specified range.  Because of this the basic Permission and Views and other stock Drupal modules seem to be ineffective.  It seems like it would be a bad way to use the Permission system because their are so many variables in the user / node relationship.  I can't unpublish nodes because they need to remain active to other users, processes, etc.  Even a dynamic Views filter with custom php code for my distance measurement would be ineffective because then nodes would still be accessible by directly inputting the URL.

Thus far, I am planning on using hook_node_load() to perform my calculations - determining the user and node relationship - and then only return nodes that are applicable.  This should prevent direct URL access to unavailable nodes, keep active nodes that exist but don't match the criteria, and by default control
You say that you do not want users to be able to enter node URLs directly. To me this suggests you do need to use permissions, as it is the only way tou can guarantee your node won't be accessed.

The reason is that you never know which parts of Drupal might be displaying your node. For instance you could manually insert a drupal_goto in hook_boot to provide your own custom permission handling, testing the URL for the node id - however the node would still be accessible via Views. The great thing with Drupal is that all sorts of modules can use your data in all sorts of ways - however this means you have to present your data (in that case, your permissions) in a way other modules will understand.

You say that your permissions are distance-based. This means you cannot use Role-based permissions, since you would end up having one role per user. What you could use however is the ACL module - this provides an API allowing you to define per-user/node permissions.

You would then need to implement hook_node_update/hook_user_update to re-calculate the permissions and change the ACL for that node/user when the node/user is changed.