I'm using the Drupal Commerce 7.x, Rules Link, and Content Access modules.
In my site Classified ads can be created, and then people can use credits (via User points) to pay for unlocking "contact informations".
For example, when an advertiser creates an ad, 2 things happen:
- content (node) of type "Classified ad" is created, and
- it is cloned and converted in another content (node) of type "Classified complete".
So there will be 2 different nodes: the first one is a "Classified ad" and the second one is a "Classified complete".
The "Classified ad" is the node which has limited information and the "Classified complete" is the node which has all information. They are all linked together with the "Rules link" module.
The "Classified ad" node is displayed for everyone and the "Classified complete" node linked to it can be accessed only if a user paid for it already.
More info about my current setup as described above is included also in my related question "How to access node properties of another node using the Rules Link module?".
Now I want to further refine the display of the link shown via "Rules Link": I want to display a link rules in "Classified ad" nodes only if all these conditions are satisfied:
- The current user is an authenticated user (done, as per my linked question).
- The current user already bought the node "Classified complete" so the user has an access granted to that node (with the Content access module).
- A page redirect to the node "Classified complete"(done, as per my linked question).
How to check if my current logged in user already has the access granted to a node id (the 2nd condition in the previous list)?