I'm building an app for SharePoint 2013. I've got permissions set at Manage Web (to meet the store guidelines). I'm trying to add a webpart to a page in thehost web. This is all in SharePoint Online (via a developer account).
In the App Installed event, I'm getting a LimitedWebPartManager from the client context, importing some webpart xml (from a Content Editor web part) & adding it to the page. When I call ExecuteQuery(), it blows up, saying:
A Web Part or Web Form Control on this Page cannot be displayed or imported. You don't have Add and Customize Pages permissions required to perform this action.
I did some digging on permission levels and according to this page (http://technet.microsoft.com/en-us/library/jj219576(office.15).aspx), the Manage permission set contains the Add & Customize Pages permission (on the page linked, see App permission requests table).
I've tried the manage web & manage site collection permissions, but both give me the same error. The web part XML is valid, as it was exported from the site.
Any ideas where to go from here?