SharePoint中自定义代码普通用户执行报Access Denied, 管理员执行就OK, 咋办?
2012-03-13 18:04
239 查看
正解如下:
把出错的代码调用放在SPSecurity.RunWithElevatedPrivileges中, 即可.
举例
MSDN解释该方法的功能如下:
Executes the specified method with Full Control rights even if the user does not otherwise have Full Control.
参考资料
==============
SPSecurity.RunWithElevatedPrivileges Method
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsecurity.runwithelevatedprivileges.aspx
把出错的代码调用放在SPSecurity.RunWithElevatedPrivileges中, 即可.
举例
SPSecurity.RunWithElevatedPrivileges(delegate() { // implementation details omitted });
MSDN解释该方法的功能如下:
Executes the specified method with Full Control rights even if the user does not otherwise have Full Control.
参考资料
==============
SPSecurity.RunWithElevatedPrivileges Method
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsecurity.runwithelevatedprivileges.aspx
相关文章推荐
- Lsrunase普通域用户以管理员身份执行某个软件
- [原创]java WEB学习笔记45:自定义HttpFilter类,理解多个Filter 代码的执行顺序,Filterdemo:禁用浏览器缓存的Filter,字符编码的Filter,检查用户是否登陆过的Filter
- RedHat中让普通用户安全执行管理员程序
- linux简单方法实现让普通用户执行管理员命令
- linux普通用户执行管理员权限visudo
- 让自定义用户控件中代码的执行分成“设计时”和“运行时”
- PowerShell 如何让普通用户以管理员权限执行程序
- 一种基于自定义代码记录用户访问日志在Sharepoint网站的应用方法!
- 一种基于自定义代码记录用户访问日志在Sharepoint网站的应用方法!
- 应用程序按照以下顺序执行由 global.asax 文件中定义的模块或用户代码处理的事件
- ansible 普通用户执行root权限 su
- 一步一步学习sharepoint2010 workflow 系列第二部分:SharePoint无代码工作流 第7章 自定义表单的基础知识(Custom form fundamentals)
- 关于普通用户执行mount的问题
- idea jetty插件启动服务后,修改代码报“请求的操作无法在使用用户映射区域打开的文件执行”
- 普通用户怎样获得管理员权限
- 普通用户执行脚本具有root用户权限
- ubuntu 普通用户改为管理员模式方法
- 如何让普通用户执行一些root用户才能执行的命令
- 禁止在 .NET Framework 中执行用户代码。启用 "clr enabled" 配置选项
- 普通用户登录PLSQL后提示空白OK对话框错误