From 44dc138d8b7a957f9db39fd1a017c0267dfd0829 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 15 Aug 2012 18:22:52 +0200 Subject: Let the temp attachment module add a command to allow attaching without permissions and add support for this (incomplete!) to LSL --- .../Shared/Api/Implementation/LSL_Api.cs | 51 ++++++++++------------ 1 file changed, 22 insertions(+), 29 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 54cb214..1115542 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3753,29 +3753,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.AddScriptLPS(1); + int implicitPerms = 0; + if (m_host.ParentGroup.IsAttachment && (UUID)agent == m_host.ParentGroup.AttachedAvatar) { // When attached, certain permissions are implicit if requested from owner - int implicitPerms = ScriptBaseClass.PERMISSION_TAKE_CONTROLS | + implicitPerms = ScriptBaseClass.PERMISSION_TAKE_CONTROLS | ScriptBaseClass.PERMISSION_TRIGGER_ANIMATION | ScriptBaseClass.PERMISSION_CONTROL_CAMERA | ScriptBaseClass.PERMISSION_TRACK_CAMERA | ScriptBaseClass.PERMISSION_ATTACH; - if ((perm & (~implicitPerms)) == 0) // Requested only implicit perms - { - m_host.TaskInventory.LockItemsForWrite(true); - m_host.TaskInventory[m_item.ItemID].PermsGranter = agentID; - m_host.TaskInventory[m_item.ItemID].PermsMask = perm; - m_host.TaskInventory.LockItemsForWrite(false); - - m_ScriptEngine.PostScriptEvent(m_item.ItemID, new EventParams( - "run_time_permissions", new Object[] { - new LSL_Integer(perm) }, - new DetectParams[0])); - - return; - } } else { @@ -3796,26 +3784,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (sitting) { // When agent is sitting, certain permissions are implicit if requested from sitting agent - int implicitPerms = ScriptBaseClass.PERMISSION_TRIGGER_ANIMATION | + implicitPerms = ScriptBaseClass.PERMISSION_TRIGGER_ANIMATION | ScriptBaseClass.PERMISSION_CONTROL_CAMERA | ScriptBaseClass.PERMISSION_TRACK_CAMERA | ScriptBaseClass.PERMISSION_TAKE_CONTROLS; + } + else + { + if (World.GetExtraSetting("auto_grant_attach_perms") == "true") + implicitPerms = ScriptBaseClass.PERMISSION_ATTACH; + } + } - if ((perm & (~implicitPerms)) == 0) // Requested only implicit perms - { - m_host.TaskInventory.LockItemsForWrite(true); - m_host.TaskInventory[m_item.ItemID].PermsGranter = agentID; - m_host.TaskInventory[m_item.ItemID].PermsMask = perm; - m_host.TaskInventory.LockItemsForWrite(false); + if ((perm & (~implicitPerms)) == 0) // Requested only implicit perms + { + m_host.TaskInventory.LockItemsForWrite(true); + m_host.TaskInventory[m_item.ItemID].PermsGranter = agentID; + m_host.TaskInventory[m_item.ItemID].PermsMask = perm; + m_host.TaskInventory.LockItemsForWrite(false); - m_ScriptEngine.PostScriptEvent(m_item.ItemID, new EventParams( - "run_time_permissions", new Object[] { - new LSL_Integer(perm) }, - new DetectParams[0])); + m_ScriptEngine.PostScriptEvent(m_item.ItemID, new EventParams( + "run_time_permissions", new Object[] { + new LSL_Integer(perm) }, + new DetectParams[0])); - return; - } - } + return; } ScenePresence presence = World.GetScenePresence(agentID); -- cgit v1.1