The code below only executes if the user is a member of site collection admin. How can I modify the code so that it runs for users with Full control as well as Read/Write please?
var clientContext = SP.ClientContext.get_current();
// Fetch all groups because I can't just grab those for this subsite.
this.collGroup = clientContext.get_web().get_siteGroups();
clientContext.load(collGroup);
clientContext.load(collGroup, 'Include(Users)');
clientContext.executeQueryAsync(Function.createDelegate(this, function() {
var groupsInfo = '';
var groupsEnumerator = collGroup.getEnumerator(); while (groupsEnumerator.moveNext()) {
var oGroup = groupsEnumerator.get_current();
// alert(oGroup.get_title());
Also, The code will create the SharePoint group if it does not exists.
How can I force these codes to run for users with Full and Edit rights?
faye fouladi