且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从itemlisted事件接收器的currentlistitem中保留角色权限,然后再次重新添加

更新时间:2023-12-05 21:32:10

我们可以创建一个项目权限历史记录列表(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