How to restrict node access based on viewer use role and node author user role? I have two Profile2 profile types, and each one automatically applies a specific user role to the user account:


Man
Woman


All users have the ability to add a specific type of node... let's call it "Event".

Man users should never see other Man-user-created events. They should only see Woman-user-created events

Woman users should never see other Woman-user-created events. They should only see Man-user-created events.

I already have the permissions set up where Man users cannot view other Man user profile pages, and likewise for Woman users. How can I apply that same logic/permission restriction to the content those user types create?
Just tried this in my sandbox.
You can do this by using Content Access together with Rules.
The configuration would go like this:


Activate the following modules: Rules, Content Access and Content Access Rules Integrations (a submodule of Content Access)
On your content type - Event - under Access Control, activate "Enable per content node access control settings"
Create two new Rules:


For content created by a member of the Men role:


Event: After saving new content of type Event 
Condition:  User has role(s), Parameter: User: [node:author], Roles: men
Action: Revokes Access to the newly created node for the role men. To do that check all but "women" in the "Role-based access control settings" &gt; "View any content" acl group

For content created by a member of the Women role:


Event: After saving new content of type Event 
Condition:  User has role(s), Parameter: User: [node:author], Roles: women
Action: Revokes Access to the newly created node for the role women. To do that check all but "men" in the "Role-based access control settings" > "View any content" acl group




Once these Rules are in place, any new content of type Event will have an ACL configuration (per node) that will block members of the same role and allow members of the opposite role to view it. You would probably need to tweak this more to match your goals but this should get you going.  

Hope it helps!