2011-03-22 91 views
1

我正在创建一个链接并将其放入网站操作容器中。 该链接只能显示给HR组中的成员。 这里是我的Elements.xml的声明文件自定义操作和组

<Elements xmlns="http://schemas.microsoft.com/sharepoint/"> 
    <CustomAction Rights="ManageWeb" Id="UM" 
     Description="View and manage user profile" 
     Title="User Management" GroupId="SiteActions" 
     Location="Microsoft.SharePoint.StandardMenu" Sequence="10"> 
     <UrlAction Url="~site/_layouts/UM/Overview.aspx" /> 
    </CustomAction> 
    <HideCustomAction HideActionId="UM" GroupId="SiteActions" 
     Location="Microsoft.SharePoint.StandardMenu" Id="hideUM" >  
    </HideCustomAction> 

我的问题是如何连接这两个链接和组之间。 任何帮助非常感谢。 在此先感谢。

回答

0

大约一年前,我问过这个问题。那时我对SharePoint非常陌生。现在我知道,控制自定义操作的可见性是使用Rights属性。要连接链接和组,请将组permission设置为Manage Webs权限级别

1

我认为HideCustomAction元素只是为了在没有任何条件的情况下隐藏现有的CustomAction。这意味着您的HideCustomAction元素(hideUM)只会隐藏上面的CustomAction元素(UM)。 您可以通过创建自定义控件(ControlAssembly和ControlClass属性)并在其中实现可见性逻辑来控制CustomAction。