Hey guys,
I am trying to get the users of a group like this :
GroupCollection userGroups = ctx.Web.SiteGroups; ctx.Load(userGroups,groups => groups.Include(group => group.Title,group => group.Id,group => group.Users.Include( user => user.Title, user => user.Email)));
At executeQuery, I receive the following error " Microsoft.SharePoint.Client.ServerUnauthorizedAccessException: Access denied. You do not have permission to perform this action or access this resource. "
The code is ran from a web application that has the app pool identity an user which is in the owner group of the sitecollection.
I also receive the same error at the following code:
ListItem li = listItems[0];
clientContext.Load(li.RoleAssignments); clientContext.ExecuteQuery();
or
foreach (var group in userGroups) { ctx.Load(group.Users); ctx.ExecuteQuery(); }
Only the site owner / system account doesn't receive that error.
Does anybody have any ideas?
Thank you,
Dan