Search code examples
sharepointribbon

SharePoint CustomAction button for edit user permissions


everyone. Please tell what is the location and group for this ribbon (List settings - list permissions) for CustomAction element and for CommandUIDefinition? I tryed different from this page https://msdn.microsoft.com/en-us/library/bb802730(v=office.14).aspx but not successfully. Here is my element:

<?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>

Solution

  • In this file I found all groups and locations and much more \14\TEMPLATE\GLOBAL\XML\CMDUI.XML So, my customaction now looks like:

    <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>