在SharePoint列表/文档库中隐藏“新建"/“操作"/“上载"/“设置"菜单 [英] Hide New / Actions / Upload / Settings menus in SharePoint Lists / document libraries

查看:95
本文介绍了在SharePoint列表/文档库中隐藏“新建"/“操作"/“上载"/“设置"菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在SharePoint的列表或文档库中隐藏新建"/操作"/上载"/设置"菜单?请注意,我需要能够为特定的列表定义(模板)而不是所有列表或文档库隐藏这些菜单.

How can I hide the New / Actions / Upload / Settings menus within a list or document library in SharePoint? Note that I need to be able to hide these menus for a particular list definition (template) and not just all lists or document libraries.

我知道的一种可能的方法是注册一个,并将ControlClass元素设置为从WebControl继承的控件.在WebControl中,我可以重写OnPreRender,然后执行此操作:

One possible way that I know of is to register a , and set the ControlClass element to a control that inherits from WebControl. In the WebControl, I can override OnPreRender, which then does this:

foreach (Control control in this.Parent.Controls)
{
    if (control.ToString() == "Microsoft.SharePoint.WebControls.NewMenu")
    {
        control.Visible = false;
    }

    // etc
}

这很hacky,我只是想知道是否有更好的方法?

This is pretty hacky, and I was just wondering if there is a better way of doing it?

推荐答案

您可以使用属于SharePoint 2007功能Codeplex项目一部分的工具栏管理器Web部件来实现此目的. http://features.codeplex.com/

You can acheive this using the Toolbar Manager web part that is part of the SharePoint 2007 Features Codeplex project. http://features.codeplex.com/

您需要将Web部件添加到每个视图网页,但是它允许您隐藏菜单项而无需编码.

You need to add the web part to the each view web page, but it allows you to hide menu items without coding.

如果某些用户需要菜单项,请授予他们添加个人视图的权限.当他们创建个人视图时,默认情况下将不安装Web部件.同样,您将需要禁止不应访问菜单项的用户使用个人视图.

If some users need the menu item, give them permission to add personal views. When they create a personal view, the web part will not be installed by default. As well, you will need to disallow personal views for users that should not be to access the menu items.

这篇关于在SharePoint列表/文档库中隐藏“新建"/“操作"/“上载"/“设置"菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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