I've come across a client requirement in Drupal that is very new to me.
The website is subscriber based, so users pay to subscribe at which point they are granted a subscriber role. They then have access to particular content types that they did not previously have access to. This is all easy enough.
The challenge though is that they require each node to only be accessible 5 times by each user.
The website is running Drupal 7 and presently has both Content Access and NodeAccess modules installed along with Rules and Flag.
So far I've worked out how to block access to an entire content type using Rules and roles. I've also been experimenting with Rules and Flags to block a node. For example:
If a node is flagged 5 times by the same user, it should be blocked.
But it still seems to come back to requiring a role that is not able to access it. It's impractical to have a role for every piece of content that cannot be accessed though. Content Access and NodeAccess also revolve around roles.
It seems like every possibility I come across requires a role in order to prevent access, which just doesn't work for this situation as every user is going to potentially have a number of different nodes they cannot access and they are all going to be different. This severely limits the ability of roles to work as far as I can see.
Does anyone have any ideas that might be able to point me in the right direction to achieve this?
Thanks in advance for your help!