防止从 SharePoint 列表项中删除附件
我们有一个自定义 SharePoint 列表类型。我们列表的部分功能取决于每个列表项是否存在特定附件。当用户意外或故意删除列表项的附件(名为DoNotDelete.fi!)时,我们的该项目的功能就会被破坏。因此,我们希望阻止用户删除该特定列表项附件(但应该能够编辑列表项)。
这可以通过使用此列表项的EventReceiver来实现吗?鉴于附件存储在列表的 RootFolder 中,也许 EventReceiver 不需要附加到列表项,而是附加到其他地方?
We have a custom SharePoint list type. Part of our list's functionality depends on the existence of a specific attachment for each list item. When the user accidentally or intentionally deletes the attachment (named DoNotDelete.fi!) of a list item our functionality for that item is broken. Therefore we would like to prevent user from being able to delete that particular list item attachment (but should be able to edit the list item otherwise).
Can this be achieved through the use of an EventReceiver for this list item? Given that the attachments are stored in the RootFolder of the list, maybe the EventReceiver needs to be attached not to the list item but elsewhere?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,有可能,我曾经创建过这样的结构。
您必须实现
SPItemEventReceiver
的ItemAttachmentDeleting
方法。请在此处查看所有可能的方法:http://msdn.microsoft。 com/en-us/library/microsoft.sharepoint.spitemeventreceiver_members.aspx
Yes, it is possible, I have created such a construction once.
You have to implement the
ItemAttachmentDeleting
method of anSPItemEventReceiver
.See all possible methods here: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spitemeventreceiver_members.aspx