本文介绍了在Windows Sharepoint Services 3.0中仅编辑拥有的列表项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将WSS 3.0中的编辑项目"权限限制为仅允许用户编辑自己的文档或列表项目?我们需要用户只能编辑他创建的文档/列表项的能力,而不能编辑其他人创建的项的能力.因此,从本质上讲,我们需要EDIT权限以及ADD的子集.

Is there a way to limit the "edit item" permission in WSS 3.0 to only allow a user to edit his own documents or list items? We need the ability for a user to edit only documents/list items he creates - NOT items that someone else created. So, essentially we need a sub-set of the EDIT permission as well as ADD.

在Windows Sharepoint Services 3.0中可能吗?有没有办法在代码或功能中创建自定义权限?

Is this possible in Windows Sharepoint Services 3.0? Is there a way to create custom permissions in code or a feature?

推荐答案

WSS具有用于在列表项上设置项目级权限的基本UI,但它们在文档库的UI中隐藏了该权限.如果进入Settings->List Settings->Avanced settings列表,您将看到执行您所需要的几乎所有操作的选项.但是,在文档库上,该UI不可用.驱动的设置虽然可以通过对象模型获得.

WSS has a basic UI for setting item-level permission on list items, but they hide that from the UI for document libraries. If you go into Settings->List Settings->Avanced settings for a list, you'll see the options to do pretty much what you're asking for. However, on document libraries, that UI is not available. The settings it drives, though are avaiable via the object model.

您可以为文档库设置相同的属性,如下所示:

You could set those same properties for a document library like this:

SPDocumentLibrary onlyOwnLib = theWeb.Lists["DocLibName"]
onlyOwnLib.WriteSecurity = 2;
onlyOwnLib.Update();

那应该去做.但是,显然这并没有真正设置权限.它只是控制用户可以通过用户界面执行的操作.如果他们有另一个到库的接口(如通过WebDAV)或列表(如通过Web服务),则不会阻止他们编辑未创建的项目.如果您需要真正的项目级权限,我认为您需要走事件处理程序路线.

And that should about do it. However, apparently that doesn't really set permissions; it just controls what the user can do via the UI. If they had another interface to the library (like via WebDAV) or list (like via the web services), it wouldn't prevent them from editing items they didn't create. If you want true item-level permissions, I think you need to go the event handler route.

帖子对此进行了更详细的解释,他甚至编写了命令行工具来设置列表和库的属性(加上.ReadSecurity属性).

This post from Matt Morse explains it in more detail, and he even wrote a command line tool to set the property (plus the .ReadSecurity property) for lists and libraries.

这篇关于在Windows Sharepoint Services 3.0中仅编辑拥有的列表项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-01 01:17