在 Windows Sharepoint Services 3.0 中仅编辑拥有的列表项 [英] Edit only owned list items in Windows Sharepoint Services 3.0

查看:27
本文介绍了在 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->Advanced 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();  

那应该差不多了.但是,显然这并没有真正设置权限;它只是控制用户可以通过 UI 执行的操作.如果他们有另一个到图书馆的界面(比如通过 WebDAV)或列表(比如通过网络服务),它不会阻止他们编辑不是他们创建的项目.如果您想要真正的项目级权限,我认为您需要走事件处理程序路线.

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.

这个post 对此进行了更详细的解释,他甚至编写了一个命令行工具来设置列表和库的属性(加上 .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 中仅编辑拥有的列表项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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