Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11508

Sharepoint ClientObject Model ctx.Load(group.users) - Access Denied exception

$
0
0

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




Viewing all articles
Browse latest Browse all 11508

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>