用于编辑用户权限的SharePoint CustomAction按钮

时间:2015-02-20 09:09:37

标签: sharepoint ribbon

大家。请告诉CustomAction元素和CommandUIDefinition的此功能区的位置和组(列表设置 - 列表权限)是什么? 我尝试了与此页https://msdn.microsoft.com/en-us/library/bb802730(v=office.14).aspx不同但不成功。 这是我的元素:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction
  Id="BreakRoleInheritance"
  Location="CommandUI.Ribbon"
  Rights="FullMask">
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition
          Location="Ribbon.Permission.Parent">
          <Button
           Id="Ribbon.ListEdit.Permissions.BreakRoleInheritance"
           Alt="Break Role Inheritance"
           Sequence="1"
           Image32by32="/_layouts/1049/images/formatmap32x32.png"
           Image32by32Left="-384"
           Image32by32Top="-32"
           Command="BreakRoleInheritance"
           LabelText="Break Role Inheritance"
           CommandType="General"/>
        </CommandUIDefinition>
      </CommandUIDefinitions>
      <CommandUIHandlers>
        <CommandUIHandler
         Command="BreakRoleInheritance"
         CommandAction="javascript:alert('Hello World');" />
      </CommandUIHandlers>
    </CommandUIExtension>
  </CustomAction>
</Elements>

2 个答案:

答案 0 :(得分:0)

我从来没有这样做,但有可能是

Ribbon.BDCAdmin.PermissionManagement

不确定这是否正确但请尝试

https://msdn.microsoft.com/en-us/library/ee537543(office.14).aspx

希望这有帮助

答案 1 :(得分:0)

在此文件中,我找到了所有组和位置以及更多\ 14 \ TEMPLATE \ GLOBAL \ XML \ CMDUI.XML 所以,我的习惯现在看起来像:

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction ScriptSrc="Script.js" Location="ScriptLink" Sequence="1">
  </CustomAction>
  <CustomAction
    Id="N.Ribbon.BreakRoleInheritanceButton"
    Location="CommandUI.Ribbon">
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition Location="Ribbon.Permission.Parent.controls._children">
          <Button
            Id="N.Ribbon.BreakRoleInheritanceButton"
            Alt="Прекратить и очистить наследование разрешений"
            Command="N.Ribbon.BreakRoleInheritanceButton.Command"
            Sequence="31"
            Image16by16="/_layouts/$Resources:core,Language;/images/formatmap16x16.png" Image16by16Top="-144" Image16by16Left="-112"
            Image32by32="/_layouts/$Resources:core,Language;/images/formatmap32x32.png" Image32by32Top="-32" Image32by32Left="-384"
            Description="Прекратить наследование разрешений и очистить имеющиеся"
            LabelText="Прекратить и очистить наследование разрешений"
            ToolTipTitle="Прекратить и очистить наследование разрешений"
            ToolTipDescription="Прекратить наследование разрешений и очистить все имеющиеся разрешения"
            TemplateAlias="o1" />
        </CommandUIDefinition>
      </CommandUIDefinitions>
      <CommandUIHandlers>
        <CommandUIHandler
          Command="N.Ribbon.BreakRoleInheritanceButton.Command"
          CommandAction="javascript: breakSecurityInheritance();"
          EnabledScript="javascript: getObjectProperties();"/>
      </CommandUIHandlers>
    </CommandUIExtension>
  </CustomAction>
</Elements>