SharePoint 2013 ‘SharePoint Hosted’ App Permissions

SharePoint 2013 ‘SharePoint Hosted’ App Permissions

It turns out this SharePoint 2013 dev malarkey is actually pretty good! I’m working on a SharePoint hosted app at the moment which queries the User Profile Service using SP.UserProfiles.js. It’s nice to see that we have a decent javascript API to use now when querying user profiles.

Anyhow my code was failing when trying to retrieve a User Profile Property with the following exception –

Access denied. You do not have permission to perform this action or access this resource.

It turns out the AppManifest.xml is the key, in here you can set Permission requests that your App will be able to perform e.g. read from the current web, write to the Taxonomy service etc. In my case I hadn’t set the read permission for the User Profile service.

Permission requests

Once I had set this up. hey presto it worked!!

3 thoughts on “SharePoint 2013 ‘SharePoint Hosted’ App Permissions

  1. Mike Hudson

    Brilliant post Alex, thanks – saved me hours of banging my head trying to retrieve user properties from a hosted 2013 site.

    This simple change in the manifest was all it took!


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">