Skip to content

Instantly share code, notes, and snippets.

@ktskumar
Last active March 5, 2020 06:52
Show Gist options
  • Save ktskumar/7cd6c870b67bfcef655003bf14d8bfca to your computer and use it in GitHub Desktop.
Save ktskumar/7cd6c870b67bfcef655003bf14d8bfca to your computer and use it in GitHub Desktop.
Validate whether members can share the SharePoint Site and its folders & files
//getRequest method reference
//https://gist.github.com/ktskumar/a9e9df497673e9fd26ead8532b9ff425
//Modify domain.sharepoint.com with your SharePoint site URL
getRequest("https://domain.sharepoint.com/_api/web?$select=MembersCanShare").then(function(output) {
var result = JSON.parse(output.response);
if (result.MembersCanShare){
alert("Members can share this site and its folder & files");
}else{
alert("Members do not have permission to share this site!");
}
});
//Shantha Kumar T
//https://www.ktskumar.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment