This article is a basic example of developing a SharePoint-hosted SharePoint Add-in and deploying to SharePoint online site
Prerequisite: Active users are added to the Office 365 site and granted permission to access the SharePoint online.
Requirement: Develop a SharePoint-hosted SharePoint Add-in to get user's permission at the site level
Solution:
Create the add-in project
- Start Visual Studio
- Choose File > New > New Project.
- In the New Project dialog box, expand the Visual C# node, expand the Office/SharePoint node, and then choose Add-ins > Add-in for SharePoint.
- Name the project, and then choose OK.
- Specify the Add-in for SharePoint Settings dialog box, provide the full URL of the SharePoint site that you want to use to debug your add-in. This is the URL of the Developer Site. (Use HTTPS, not HTTP in the URL.) Under How do you want to host your SharePoint Add-in, choose SharePoint-hosted. Choose Finish.
- Provide your subscription administrator's credential if prompted to login to your Developer Site.
- In Specify the target SharePoint version page, select SharePoint Online, and then click Finish button
Code your add-in
Following is the project items created by default template. Refer to this MSDN article for more information about each project item
Publish the Add-in
Deploy the Add-in to the developer site.
Developer Site home page with the Add-ins in Testing list
Run the add-in
Note: User running this app should have appropriate permission to get the permission level for other users. A full control permission is recommended in this case.
No comments:
Post a Comment