I have an XsltListViewWebPart WebPart on a webpage within the App Web of a SharePoint Hosted App. Right now you can highlight a row and click delete. Is there a property or way I can prevent users from hitting delete on a row?

        <WebPartPages:WebPartZone runat="server"
            PartChromeType="TitleOnly"  ID="full" Title="loc:full">
            <WebPartPages:XsltListViewWebPart ID="XsltListViewWebPart2" AllowEdit="false"
                runat="server" ListUrl="Lists/ListName" IsIncluded="True"
                NoDefaultStyle="TRUE" Title="Hello World!"
                PageType="PAGE_NORMALVIEW" Default="False"
  • Do you need a solution that doesn't involve setting permissions on items? If so I think the way to go is through javascript, but don't forget that a client-side solution like this will not prevent deleting items using another methods. – Marcelo Espinosa Aug 18 '16 at 16:20
  • It would be better if I didn't have to set permissions. What would the JS solution look like? – Michael Colbs Aug 18 '16 at 16:22

Permission appropriately, if users aren't to delete items, don't give them contribute or higher permissions, or create a custom permission level based on the contribute permission level, uncheck delete items, and apply this to your list/library.

A javascript based solution is only obscuring functionality that they would natively have.

  • I guess I should have mentioned this is in a SharePoint Hosted app and the List is provisioned in the App Web. I'd rather lock down the list and prevent this one webpart from deletion than deal with various tiers of user groups and their individual permissions. All native functionality is already hidden or inaccessible – Michael Colbs Aug 18 '16 at 16:39

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.