I need to check if user is part of an AD Group with Javascript.
I've created a SP group and I added an AD Group to it and I am part of this group.
I removed my user from Site Administrators and Site owners (group with full control).
Then I tried the code found here: https://stackoverflow.com/a/43673723/2185964
But the code above did not worked. Is it possible that it is an issue caused by users profile sync? Or there is a way to add to SharePoint user profile the AD group or OU or AD directory where an user belongs and get this property using JavaScript?