用于编辑用户权限的 SharePoint CustomAction 按钮
SharePoint CustomAction button for edit user permissions
各位。请告诉 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>
我从来没有这样做过,但我猜它可能是
Ribbon.BDCAdmin.PermissionManagement
不确定这是否正确但试一试
https://msdn.microsoft.com/en-us/library/ee537543(office.14).aspx
希望对您有所帮助
在这个文件中,我找到了所有组和位置以及更多 \TEMPLATE\GLOBAL\XML\CMDUI。XML
所以,我的 customaction 现在看起来像:
<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>
各位。请告诉 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>
我从来没有这样做过,但我猜它可能是
Ribbon.BDCAdmin.PermissionManagement
不确定这是否正确但试一试
https://msdn.microsoft.com/en-us/library/ee537543(office.14).aspx
希望对您有所帮助
在这个文件中,我找到了所有组和位置以及更多 \TEMPLATE\GLOBAL\XML\CMDUI。XML 所以,我的 customaction 现在看起来像:
<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>