Categories
CMS Drupal Mastering Development

How to filter nodes on a view based on user role shared by both nodes authors and current user?

Working on Drupal 8.9.1

I need to list nodes with Views and filter them based on user role shared by both nodes authors and current user.

If I add a relationship to content author and a contextual filter on (author)User ID with default provided by logged user ID, I only get nodes authored by the current user.

Let’s say we have a role "Staff A", I need any user with this role to be able to see any nodes from any users with the same role "Staff A".

Thanks for any tip here.

Leave a Reply

Your email address will not be published. Required fields are marked *