从文档库项目中删除项目级别权限-权限的替代方法 [英] Remove item level permissions from document lib items - alternative for permissions

查看:111
本文介绍了从文档库项目中删除项目级别权限-权限的替代方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正在尝试删除文档库中各项的项目级别权限".

am在splist中有一个ProjectCode字段,并且在doc lib中有很多带有文档的项目.每当splist字段中状态发生变化时[称为projstatus-> 从活动到过时过时->保持保持->有效],我需要为doc lib中的文档应用项目级别权限.即,对于一个名为projectlead的角色,将获得贡献权限 状态从保持更改为splist时处于活动状态的文档.我已经为splist编写了事件接收器[sp 2013 -on-premises-itemupdated事件接收器].但是当涉及到对每个n个devery项的权限的破坏时, 在文档lib中具有匹配的项目代码,对我来说将是一件昂贵的事情.[似乎,听说过abt 5000作为限制权限集].

下面是我尝试在itemupdating方法中应用properties.cancel时看到的图片:

在前端UI中,我正在显示项目负责人的项目代码,他将在选择了项目代码的文档库中查看所有文档.

现在,他将从这个自定义UI中获取文档的链接并更新文档,或者只是基于权限进行读取.这里是要抓住的地方.如果项目处于暂缓或过时状态,则项目负责人不编辑文档/不编辑属性/元数据.

如果项目状态从过时更改为活动,或从保留状态更改为活动,则项目负责人应能够通过我的自定义界面/文档的属性/元数据来编辑文档库中的文档.

我的问题是不对doclib中的文档授予项目级别权限,仅通过检查splist中所选项目代码的statusfield的状态,如何实现只读/编辑文档?? >

&sp; splist项目状态

  

解决方案

你好

您可以尝试使用事件接收器并还原状态=保留的文档的更改.将以下代码添加到ItemUpdating事件处理程序中:

 properties.Status = SPEventReceiverStatus.CancelWithError;
properties.ErrorMessage =文档处于保留状态";
properties.Cancel = true; 


Am trying to remove the ITEM LEVEL PERMISSIONS for the items in a  document library.

am having a ProjectCode field in a splist, and there are many items with documents avaiable in the doc lib .[ this doc lib also having the projectcode field and other metadata ]. whenever there is a status change in the splist field [ called projstatus --> from active to obsolete or obsolete --> hold or from hold --> active ] i need to apply the item level permissions for the documents in the doc lib . ie, for a role called projectlead , will be getting the contribute permissions for the documents when the status changed from hold-->active in the splist. i already written the event receiver [ sp 2013 -on-premises- itemupdated event receiver] for the splist. but when it comes to breaking the permissions for each n devery item thats havng the matching projectcode in the document lib, is going to be a costly affair for me.[ it seems , heard abt 5000 as a limit permission sets ]. 

below is the pic am seeing when i tried to apply properties.cancel in itemupdating method:

and in the front-end UI, i am displaying the project codes for the projectlead and he will be viewing all the documents from the document library where the projectcode is selected.

now, from this custom UI,he will be getting the link of the document and update the document or just read based on the permissions. here is the catch. if the project is  hold or obsolete, projectlead shud not edit the document / shud not edit the properties/metadata.

if the projectstatus is changed from obsolete to active or from hold to active,  projectlead shud be able to edit the document from the doc lib, thru my custom UI / edit the properties /metadata of the doc.

my question is  without apllying the item level permissions for the documents within the doclib, how can i achieve the readonly/ edit documents , just by checking the status of the statusfield of the selected projectcode in the splist.?

 splist proj status

  

解决方案

hello

you can try to use event receiver and revert changes of the documents which has status = hold. Add the following code to ItemUpdating event handler:

properties.Status = SPEventReceiverStatus.CancelWithError;
properties.ErrorMessage = "Document is on hold";
properties.Cancel = true;


这篇关于从文档库项目中删除项目级别权限-权限的替代方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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