Handler指定项目级别权限

Handler指定项目级别权限

本文介绍了使用Sharepoint List Event Handler指定项目级别权限,但指定到用户具有Contribute权限的列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  1. 我有一个列表,用户有权对其进行贡献
  2. 我有一个事件处理程序,它通过添加或更新列表中的事件来更改项目级别权限2.a CurrentlistItem.BreakRoleInheritance(true);2.b并将用户添加到该列表中
  1. I have a List to which users have contribute rights
  2. I have a Event Handler which changes the Item Level Permissions on adding or Updating events on list by2.a CurrentlistItem.BreakRoleInheritance(true);2.b and by adding users to that list

现在上方的不起作用,如果要添加的用户具有贡献权但是如果用户拥有完全控制权,则有效.

Now above does not work if user who is adding has rights of contributebut works if users has full control.

我认为解决方案可能是由系统管理员用户运行这些特权调用.

I think a solution could be to run these privileged calls by system admin user.

我该如何解决此问题,请指导,谢谢.

How can i solve this problem , Please guide, Thanks.

//授予

推荐答案

您是否尝试过 RunWithElevatedPrivileges ?只需记住在其中运行尽可能少的代码即可.

Have you tried RunWithElevatedPrivileges? Just remember to run as little code as possible within it.

这篇关于使用Sharepoint List Event Handler指定项目级别权限,但指定到用户具有Contribute权限的列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-07 00:27