There is active directory group added to SharePoint group. How would we can check that the logged in user is member of that active directory group using ECMA script?
You can't out of the box.
If you still need to do this, then look into expanding the rest api, to allow this. But a caveat on this, is this will only be possible on premises.
Reference material: http://blogs.architectingconnectedsystems.com/blogs/cjg/archive/2014/04/17/Extending-SharePoint-2013-REST-APIs.aspx
Workaround
- Create a hidden list
- Break inheritance of the list
- Give read permission only to the SharePoint group in question
- Try reading from the list using JSOM
- If read succeeds then the current user is part of the AD group, else not
Note - The above solution is not tested
-
Thanks. Was looking for a way to add validation on a people picker for a specific AD group. – David Aug 14 '15 at 11:25