CMS-4383 Add access right element to queries

Added principals to index context