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?
2 Answers
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.– DavidCommented Aug 14, 2015 at 11:25
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