1
  • I writing JSOM code to get interact with sharepoint 2013 lists and document libraries.Now I have requirement to allow anonymous users to insert the items for SharePoint Lists list.

  • Can any one help me in knowing how can I use SPSecurity.CodeToRunElevated in JSOM Code

marked as duplicate by Robert Lindgren Apr 18 '16 at 11:15

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2

You can not use elevated privileges in Client Object Model. This would open up a huge security hole. You can use elevated privileges on SSOM, where are supposed that the deploy of a page or component has been approved by someone. Instead anyone could execute client code from anywhere and hack a site.

1

No, you cannot elevate privileges in JavaScript CSOM, nor would you want to. Remember there is nothing stopping end users from crafting their own scripts and running them via a developer tool like IE's Developer Tools or Firebug. If you could elevate privileges via JavaScript, it could mean disaster on your Farm as regular users could just write a script to elevate their permissions and make some major changes.

If you need to do this from the browser, look at either a custom application page or a web service that could run on a server where you could properly elevate privileges.

You can refer this link for more information,

https://social.msdn.microsoft.com/Forums/en-US/835b0d48-8fb5-47d4-bc1a-502c18f59568/runwithelevatedprivileges-in-share-point-client-object-model

  • Thanks for your support all and providing me important information. I am site administrator and I don't have any access to Web-application in Central administration. Can any one help me in knowing Is it possible to do with any other client side program – MSA Apr 19 '16 at 6:50

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