I have read access to a sharepoint calendar and can view the page with no issues. I do not have access to the site though which is by design. I am using the code below to check if I have permission to the site. Some calendars work while others don't even though I can see events on the various calendars.
using (ClientContext clientContext = new ClientContext(url)
{
clientContext.Credentials = onlineCredentials;
string userLoginName = "i:0#.f|membership|" + owner.ToLower();
List oList = clientContext.Web.Lists.GetByTitle(listName);
clientContext.Load(oList);
var effectPermissions = oList.GetUserEffectivePermissions(userLoginName);
clientContext.ExecuteQuery();
if (effectPermissions.Value.Has(PermissionKind.ViewListItems))
{
return CallStatus.OK;
}
}
Is the GetUserEffectivePermissions check only a certain level of permission? Cant figure out why some calendars get the OK while others don't. Thanks.