Only allow llBreakAllLinks() to work if script has received PERMISSION_CHANGE_LINKS

As per http://wiki.secondlife.com/wiki/LlBreakAllLinks
Same as existing llCreateLink() and llBreakLink()
This commit is contained in:
Justin Clark-Casey (justincc)
2014-03-12 23:54:20 +00:00
parent 296d63e20b
commit 6a279feb2f
2 changed files with 50 additions and 0 deletions

View File

@@ -3922,6 +3922,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void llBreakAllLinks()
{
m_host.AddScriptLPS(1);
if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_CHANGE_LINKS) == 0
&& !m_automaticLinkPermission)
{
Error("llBreakAllLinks", "PERMISSION_CHANGE_LINKS permission not set");
return;
}
SceneObjectGroup parentPrim = m_host.ParentGroup;
if (parentPrim.AttachmentPoint != 0)
return; // Fail silently if attached