通过JSOM将项目插入列表 [英] Insert Items to the List through JSOM

查看:71
本文介绍了通过JSOM将项目插入列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我想使用具有读取权限的用户通过JavaScript对象模型将项目插入列表,我们该如何实现?

I want to insert the items to the list through the JavaScript Object Model with the read permission user, How can we achieve this?

在服务器端,我们可以通过 RunWithElevated 实现此目标 特权.

Where as in Server Side we can achieve this by RunWithElevated Privileges. 

请对此提供帮助.

谢谢

Nag 

Nag 

推荐答案

我们无法使用JSOM提升特权.解决方法是,我们可以创建一个自定义的REST服务,并使用带有SPSecurity.RunWithElevatedPrivileges方法的服务器对象模型来实现它,然后使用jQuery从客户端使用REST服务. 阿贾克斯.

We can not elevate privilege with JSOM. As a workaround, we can create a custom REST service and using the server object model with the SPSecurity.RunWithElevatedPrivileges method to achieve it, then consume the REST service from the client side using jQuery Ajax.

以下文章供您参考:

SharePoint 2013:创建在SharePoint中托管并在WSP中部署的自定义WCF REST服务

SharePoint 2013:使用jQuery Ajax使用REST API

https ://social.technet.microsoft.com/wiki/contents/articles/31995.sharepoint-2013-working-with-rest-api-using-jquery-ajax.aspx

最好的问候,

李e


这篇关于通过JSOM将项目插入列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆