Searching data via role

Hi, everyone. My problem is that I get JSON from different App where I don’t get information about the user just about the role. Can I search for data only having a role? Or if I create only one user can I search and exclude/include data that have this particular role that is assigned to a particular document or index?