Friday, February 19, 2016

SP 2013 Provider Hosted Apps - How to access items on subsite items of HostWeb

Recently I came across a problem when working with provider hosted apps. If you are trying to access items (fetching lists, or list items) in Host Web (using CSOM), then you need to set the appropriate permissions in AppManifest of the app.
With the permission "Web" you can access items on Host web, but if you want to access items on a subsite of the Host Web, then you will get "Access denied" error.

SOLUTION:
In the AppManifest you need to change permission from "Web" to "SiteCollection". This should allow you to access lists and other items on that all subsites in Host Web.




1 comment: