Suppose I have two SPSites in SharePoint Online. My app is installed on an SPWeb in one of the site collections.

enter image description here When running the app you get a context token for the site collection where the app is installed. Is is possible to get a client context for the other site collection, so my app can access data there too, given that the user running the app has sufficient permission? I don't want to use an AppOnly context, since this can't make changes to term sets in the term store.

  • If you're in SPO, you can give write access to tenant, and then app will be able to write to any list/web in any site collection, as long as the user has permissions. – wjervis Oct 21 '14 at 11:25
  • I know, but that was not what I was asking for. I am wondering if it is possible to access the tenant object without the app only permission policy? – rlv-dan Oct 21 '14 at 12:35
  • Granting an app permissions and app-only permissions are two different things. You need to grant the app ability to read/write/manage certain objects, regardless of the user's permissions. – wjervis Oct 21 '14 at 13:41
  • I guess this is possible but as mentioned by @wjervis you need to give app write permission on tenant as well as user should have that permission (as you are not using app-only policy) – Garima Oct 22 '14 at 5:31
  • Yes, the app has full control permissions over the tenancy, as does the user. So the question is, how would one instantiate a client context that can access the while tenancy without using the app only policy? – rlv-dan Oct 22 '14 at 6:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.