Implement role query.