在SharePoint中动态显示“编辑控件块”菜单项 [英] Dynamically display Edit Control Block menu item in SharePoint

查看:117
本文介绍了在SharePoint中动态显示“编辑控件块”菜单项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在SharePoint 2007中设置动态的每项菜单(编辑控件块)。我的目标是根据当前用户的组成员身份提供某些可用的功能。

I am trying to set up dynamic per-item menus (Edit Control Block) in SharePoint 2007. My goal is to have certain features that are available based on the current user's group membership.

我知道控制此菜单项创建的CustomAction标记具有Rights属性。我遇到的问题是我使用的组在站点中具有相同的权限(ViewListItems,ManageAlerts等)。我们设置的组更多地处理功能,例如Manager,Employee等。我们希望能够为组分配自定义功能,并且只有该组的成员才能看到与该功能相关的菜单项。每个人都有相同的基本站点权限,但根据他们的登录凭据将有额外的选项。

I know that the CustomAction tag that controls the creation of this menu item has a Rights attribute. The problem that I have with this is that the groups I am using have identical rights in the site (ViewListItems, ManageAlerts, etc). The groups that we have set up deal more with function, such as Manager, Employee, etc. We want to be able to assign a custom feature to a group, and have the menu items associated with that feature visible only to members of that group. Everyone has the same basic site permissions, but will have extra options availble based on their login credentials.

我看过几篇关于修改Core.js文件以隐藏项目的文章在上下文菜单中,但它们是一种全有或全无的方法。 http://blog.thekid.me.uk/archive/2008/04/29/sharepoint-custom-actions-in-a-list-view-webpart.aspx ,展示如何动态修改操作菜单。修改此示例以检查用户组并根据成员身份显示或隐藏菜单是微不足道的。不幸的是,此示例似乎不适用于上下文菜单项,如此处所示 http://forums.msdn.microsoft.com/en-US/sharepointdevelopment/thread/c2259839-24c4-4a7e-83e5-3925cdd17c44/

I have seen several articles on modifying the Core.js file to hide items in the context menu, but they are an all-or-nothing approach. There is an interesting post at http://blog.thekid.me.uk/archive/2008/04/29/sharepoint-custom-actions-in-a-list-view-webpart.aspx that shows how to dynamically modify the Actions menu. It is trivial to modify this example to check the users group and show or hide the menu based on membership. Unfortunately, this example does not seem to apply to context menu items as evidenced here http://forums.msdn.microsoft.com/en-US/sharepointdevelopment/thread/c2259839-24c4-4a7e-83e5-3925cdd17c44/.

有没有人知道如何在不使用javascript的情况下执行此操作?如果没有,从javascript检查用户组的最佳方法是什么?

Does anyone know of a way to do this without using javascript? If not, what is the best way to check the user's group from javascript?

推荐答案

不幸的是,如果不使用,这是不可能完成的JavaScript的。 ECB不会将服务器控件定义为自定义操作(与SiteActions等不同)。

Unfortunately this is not possible to accomplish without using javascript. The ECB doesn't render server controls defined as a custom action (unlike the SiteActions etc).

要了解如何使用Javascript完成此操作,请查看以下文章:
http://www.helloitsliam.com/archive/2007/08/10/moss2007-%E2%80%93-item-level-menus-investigation.aspx

To learn how to accomplish this by using Javascript check out the following article: http://www.helloitsliam.com/archive/2007/08/10/moss2007-%E2%80%93-item-level-menus-investigation.aspx

这篇关于在SharePoint中动态显示“编辑控件块”菜单项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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