自定义操作和组

时间:2011-03-22 09:12:24

标签: sharepoint-2010 custom-action

我正在创建一个链接并将其放入网站操作容器中。 该链接应仅对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>

我的问题是如何在链接和组之间连接这两个。 很感谢任何形式的帮助。 提前谢谢。

2 个答案:

答案 0 :(得分:1)

我认为HideCustomAction元素仅用于隐藏现有的CustomAction,无论条件如何。这意味着您的HideCustomAction元素(hideUM)将隐藏上面的CustomAction元素(UM)。 您可以通过创建自定义控件(ControlAssembly和ControlClass属性)来控制CustomAction,并在那里实现可见性逻辑。

答案 1 :(得分:0)

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