How to restrict node view to users by registration date? In short I'm trying to find a solution to:


Restrict view access to certain custom node types by the date the
user registered 
The user would be able to see restricted content created in
the month they registered and any future month while their user
account is active, but nothing before the date the account was created
There is existing content restrictions and
functionality for the same users on the same content. Only certain
roles can see selected node types and this is selected when the user
is created (manually). This is managed by
https://www.drupal.org/project/nodeaccess


This website has restricted content that only members (registered users) can see.

These fall into several categories and the content is divided into these categories too.  Depending on the type of member and what you been given access too, you will only be able to see that content. This is managed by Node Access and works well and as intended.

A new requirement has now popped up after the fact where this content access should be further restricted. It should honour the previously mentioned restrictions managed by nodeaccess but now apply additional parameters.  All these are relevant to the month in which the user's account is created:


Restricted content posted before must not be available 
Restricted content posted after must be available (and future
content too, but still honouring the nodeaccess restrictions)


I'm fairly capable with Drupal dev, but cannot write code or rules which I think this requirement is leaning towards. 

Anyone got any suggestion that will work or can perhaps point me in the right direction to get a start?
You need use this hook https://api.drupal.org/api/drupal/modules%21node%21node.api.php/function/hook_node_access/7

So in your module you need code smth like this

function YUORMODULE_node_access($node, $op, $account) {
  $type = is_string($node) ? $node : $node-&gt;type;

  if ($op == 'view') {
    global $user; // get current user
    // check user register date
    if ($user-&gt;created &lt; $node-&gt;created) {
      return NODE_ACCESS_DENY;
    }
  }

// Returning nothing from this function would have the same effect.
  return NODE_ACCESS_IGNORE;
}