SP 2013 On premise. Publishing enabled. We use AD Groups to organize our users. These AD groups are then added to 1 or more SP groups for the purpose of audience targeting. I now have the need to hide certain page elements (a page that I do not own and cannot put into edit mode and there are) via JavaScript. I have been able to do this successfully by adding JS on the master page however now the requirement is to show/hide elements based on an AD group membership which cannot be accomplished with JavaScript/CSOM/REST.
My thought is to pull this information and save it to a session variable and persist it from there to a field on the master page. Then it could be read by JavaScript. This could potentially be used on any page but not necessarily on every page. I am unable to edit the pages that we need it on currently as they are part of a third party solution.
Admittedly, I am looking for a quick and dirty solution as this is a last minute requirement. Just wondering what would be the best way of approaching it form a performance standpoint.
Thanks!