Sharepoint 讨论区版主权限?

发布于 2024-09-01 17:40:41 字数 342 浏览 6 评论 0原文

在 sharepoint 中,对讨论板的访问似乎可以通过两种方式进行修改。

  1. 在高级设置中,您可以修改项目级权限,使具有贡献或更高权限的用户可以编辑/删除每个人的帖子,或者只能编辑/删除他们自己的帖子。
  2. 当然,您可以调整只读、贡献、设计或完全控制的权限。

我想让所有参与讨论的用户都能够添加、编辑和删除自己的条目。但是,我想授予少数用户编辑和删除每个人的权限。

实现这一目标的最佳方法是什么?

我猜测可以编写一个 EventReceiver 并为每个用户切换“高级设置”。另一个想法是给予主持人设计特权,并删除该讨论板的设计能力。

还有其他想法吗?

In sharepoint, the access to discussion boards appears to be modified by two means.

  1. In the Advanced Settings, you can modify the Item-level Permissions to where users that have contribute or higher permission may either edit/delete everyone's posts, or only their own.
  2. And of course, you can adjust the privileges for Read-only, Contribute, Design, or Full Control.

I would like to give all of the users that contribute to the discussion the ability to add, edit, and delete their own entries. However, I would like to give a select few users the privilege to edit and delete everyone's.

What is the best way to accomplish this?

I am guessing it is possible to write an EventReceiver and toggle the "advanced setting" for each user. Another though is to give design privilege to the moderators, and remove the design capabilities for that Discussion Board.

Any other ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

分开我的手 2024-09-08 17:40:41

ReadSecurity/WriteSecurity 权限(第 1 点)应用于列表级别,而不是用户级别,因此尝试在用户基础上划分权限将非常尴尬。然而,尽管这些适用于该列表的所有用户,但具有提升权限的用户可以查看和编辑列表中的所有项目,无论此权限如何(前提是他们没有按照第 2 点的实用程序完全撤销其权限) 。我相信此权限的必要权限是“管理列表”,但完全控制肯定会起作用。

您可以通过修改用户对每个项目的实际权限级别来完成此操作,但简单地使用 ReadSecurity/WriteSecurity 会干净得多。

The ReadSecurity/WriteSecurity permissions (point #1) are applied on a list level, not a user level, so it would be extremely awkward to try to divide this on a user basis. However, although these apply to all users for that list, users of elevated privilege are able to see and edit all items on the list regardless of this permission (provided they haven't had their permissions completely revoked as per utility of point #2). I believe the requisite permission is "ManageLists" for this privilege, but Full Control will definitely work.

You could do it by modifying the actual permission levels for users on each item, but it's much cleaner to simply work with the ReadSecurity/WriteSecurity.

鲜血染红嫁衣 2024-09-08 17:40:41

作为解决方法,我实现了一个事件处理程序 (SPItemEventReceiver) 来拦截更新 (ItemUpdating) 和删除 (ItemDeleting)。

检查所有权
它将当前用户与项目[“作者”]进行比较,以确定他们是否是所有者,从而授予他们编辑/删除的权限。

属于管理员组
如果情况并非如此,那么我已经为版主添加了一个额外的用户组。其中一个关键是该组虽然不正常使用,但必须具有分配给它的 Contributor 等权限。 SPWeb有IsCurrentUserMemberOfGroup用于判断用户是否属于Moderator组。

//----------------------------------
//here is enough to get you started.
//----------------------------------

class DiscussionBoardItemCreated : SPItemEventReceiver
{
  public override void ItemUpdating(SPItemEventProperties properties)
  {
     //check ContentType 
     //  -- properties.AfterProperties["ContentType"]
     //are they the owner 
     //  -- item["Author"]
     //are they in a particular user group 
     //  -- web.IsCurrentUserMemberOfGroup(web.Groups["MyModeratorGroup"].ID)

     //properties.Cancel = true -OR- false;
     //properties.ErrorMessage = "" -OR- "No access";
  }
}

另外,您还需要 elements.xml。

来自: http:// /koenvosters.wordpress.com/2009/07/31/howto-create-an-event-handler-for-sharepointmoss-2007/

<?xml version=“1.0“ encoding=“utf-8“ ?>
<Elements xmlns=“http://schemas.microsoft.com/sharepoint/“>
   <Receivers ListTemplateId=“100“>
      <Receiver>
         <Name>AddingEventHandler</Name>
         <Type>ItemAdding</Type>
         <SequenceNumber>10000</SequenceNumber>
         <Assembly>MyEventHandler, Version=1.0.0.0, Culture=neutral,PublicKeyToken=ca176e059473d6b1</Assembly>
         <Class>MyEventHandler.DemoEventHandler</Class>
         <Data></Data>
         <Filter></Filter>
      </Receiver>
   </Receivers>
</Elements>

As a work-around, I implemented an event handler (SPItemEventReceiver) to intercept updates (ItemUpdating) and deletes (ItemDeleting).

:Check for ownership:
It compares the current user to the item["Author"], to determine if they are the owner, which gives them permission to edit/delete.

:Is in moderator group:
If that is not true, then I have added an additional user group for moderators. One key is that the group, though not used normally, must have permission such as Contributor assigned to it. The SPWeb has IsCurrentUserMemberOfGroup for determining whether the user belongs to the Moderator group.

//----------------------------------
//here is enough to get you started.
//----------------------------------

class DiscussionBoardItemCreated : SPItemEventReceiver
{
  public override void ItemUpdating(SPItemEventProperties properties)
  {
     //check ContentType 
     //  -- properties.AfterProperties["ContentType"]
     //are they the owner 
     //  -- item["Author"]
     //are they in a particular user group 
     //  -- web.IsCurrentUserMemberOfGroup(web.Groups["MyModeratorGroup"].ID)

     //properties.Cancel = true -OR- false;
     //properties.ErrorMessage = "" -OR- "No access";
  }
}

Also, you'll need to to elements.xml.

FROM: http://koenvosters.wordpress.com/2009/07/31/howto-create-an-event-handler-for-sharepointmoss-2007/

<?xml version=“1.0“ encoding=“utf-8“ ?>
<Elements xmlns=“http://schemas.microsoft.com/sharepoint/“>
   <Receivers ListTemplateId=“100“>
      <Receiver>
         <Name>AddingEventHandler</Name>
         <Type>ItemAdding</Type>
         <SequenceNumber>10000</SequenceNumber>
         <Assembly>MyEventHandler, Version=1.0.0.0, Culture=neutral,PublicKeyToken=ca176e059473d6b1</Assembly>
         <Class>MyEventHandler.DemoEventHandler</Class>
         <Data></Data>
         <Filter></Filter>
      </Receiver>
   </Receivers>
</Elements>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文