Showing posts with label Apps. Show all posts
Showing posts with label Apps. Show all posts

Saturday 29 June 2013

SharePoint Host Apps - User Permissions

Problem:  How do I give users or groups permissions in a SP Host App?  This post is not looking at giving the App Web permissions against the SharePoint Site.  It merely looks at giving users rights to work within the app.

Initial Hypothesis:
SharePoint has a structure Object hierarchy that developers can secure users against namely: SPSite (Site Collection), SPWeb (Sitess/Webs), SPList (Lists/Document Libraries) and SPItem (Rows).  Based on the hierarchy I initially assumed SP Apps would maintain their own security.  Well this would get rather confusing as you would need to maintain the host web and the app web user permissions.

There is no UI in the App web to be setting security but on the UI you can get to the lists permission page.  In the SP Hosted App, navigate to the list, in my case the url is: http://dev-d8f436fea0378f.apps.dev.local/SPHostedApp/Lists/Comment/AllItems.aspx this takes me to the "Comments" list.  I click the "List" tab on the ribbon.  Click the "Shared With" button and Choose "Advanced".


Here we can stop inheriting the security permissions for the list.
I thought I could set the App webs permissions by selecting the "Web" link.  You receive an error.

Resolution:  You need to stop inheriting permissions on the Host App (parent) and then the App web inherits theses permissions.

How if works: