1

C#:

PeopleManager peopleManager = new PeopleManager(clientContext);
PersonProperties personProperties = peopleManager.GetMyProperties();

try
{
    clientContext.Load(personProperties, p => p.AccountName, p => p.UserProfileProperties);
    clientContext.ExecuteQuery();
}
catch (Exception ex)
{
   Console.Write("error occur while retrieve person properties ", ex.Message.ToString());
}

AppManifest.xml

<AppPermissionRequests AllowAppOnlyPolicy="true">
    <AppPermissionRequest Scope="http://sharepoint/content/sitecollection" Right="FullControl" />
    <AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web" Right="FullControl" />
    <AppPermissionRequest Scope="http://sharepoint/content/tenant" Right="FullControl" />
</AppPermissionRequests>

After providing tenant permission it still showing - You do not have permission to perform this action or access this resource.

Thanks for the help!

2
  • Funny, I had the same issue today, but in PnP Powershell Jun 27, 2018 at 13:47
  • It resolved after: <AppPermissionRequest Scope="http://sharepoint/content/tenant" Right="Read" /> Sep 10, 2018 at 11:56

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.