禁止用户读取/写入SP列表 [英] Impersinate Users to read/write SP List

查看:83
本文介绍了禁止用户读取/写入SP列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用SP加载项使用读取/写入/修改/删除列表项 REST API.对于已登录的用户来说,它可以正常工作.如何添加模拟用户来执行相同的操作?该列表仅限于服务器场管理员,没有人应该可以直接访问.但是,如果有人要,他们应该 只能通过此加载项访问它.

I am working on SP Add-in to read/write/modify/delete list items using REST API. Its working fine for the logged in user. How do I add impersonate users to execute same operations?   the list is restricted only to farm administrator and no one should be able to access directly. However if anyone wants they should access it only via this add-in.

换句话说,RESET API中具有RunWithElivatedPrivillages功能,但是即使我在运行withelivatedprivillages时以系统帐户身份运行,也希望捕获属性中的实际用户名.

In other words, RunWithElivatedPrivillages feature in RESET API but would like to capture the actual username in properties even though I run as system account when runwithelivatedprivillages.

推荐答案

根据您的要求,作为一种解决方法,我建议您创建一个可视化Web部件,并在后面的代码中使用RunWithElivatedPrivillages来实现它.

Base on your requirement, as a workaround, I suggest you create a visual web part and use RunWithElivatedPrivillages in code behind to achieve it.

最好的问候,

丹尼斯


这篇关于禁止用户读取/写入SP列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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