从itemlisted事件接收器的currentlistitem中保留角色权限,然后再次重新添加 [英] Persist the role permissions from the currentlistitem in itemadded event receiver and Re-Add it again

查看:76
本文介绍了从itemlisted事件接收器的currentlistitem中保留角色权限,然后再次重新添加的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理eventreceiver- itemadded/itemupdated,在这里我需要根据某些条件来更新/修改currentlistitem的权限:

喜欢

if(status ==已分配")

  {

对项目应用编辑权限

 }

否则,如果(状态==取消分配) { 应用 阅读有关TEHE CURRENTLISTITEM的权限}

在从添加/更新的事件接收器中删除列表项的权限之前,

我可以保存所有现有权限,并在进行一些操作后再次重新添加这些权限吗?


为什么因为我不想失去currnetlistitem的现有权限,因为那是由其他功能在同一listitem上设置的.

解决方案

我们可以创建一个项目权限历史记录列表(ListGUID,ItemId,Permissions)来存储项目权限.

我们可以获取项目权限并将新项目添加到项目权限历史记录"列表中,以便在更新当前项目权限之前存储权限数据.

如果您想重新添加这些权限,我们还可以从项目权限历史记录"列表中读取数据,然后重新添加这些权限.

最好的问候,

丹尼斯


am working on a eventreceiver- itemadded/itemupdated , where i need to update/modify the permissons of a currentlistitem based on some conditions:

like

if( status == "allocated")

 {

apply editpermissions on the item

 }

 else if ( status == deallocated ) {  APPLY  READ PERMISSIONS ON TEHE CURRENTLISTITEM }

Before removing the permissions for a listitem from a itemadded/updated eventreceiver , 

can i save all the existing permissions and  re-add those permissions again after some manipulations?


why because i dont want to lose the already existing permissions of a currnetlistitem , since thats been set by other functionalities on the same listitem.

解决方案

Hi,

We can create a Item Permission History list(ListGUID, ItemId, Permissions) to store the item permissions.

We can get the item permissions and add new item to the Item Permission History list to store the permissions data before update current item permissions.

If you want to re-add those permissions, we can also read the data from the Item Permission History list and then re-add those permissions.

Best Regards,

Dennis


这篇关于从itemlisted事件接收器的currentlistitem中保留角色权限,然后再次重新添加的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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