From 8d5bcc9da11534302b36bca75ba715d9bb4029c9 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Wed, 19 Mar 2008 18:32:25 +0000 Subject: [PATCH] * Fix for if 782: Locked prims may still be moved by click+drag. * Remember, your admin user and estate managers can move locked objects that are not owned by them. That functionality differs from the Linden way of thinking and it's by design! It is not a bug! Create a non-god user and use that as your normal account. --- .../Region/Environment/PermissionManager.cs | 34 +++++++++++++++++++ .../Region/Environment/Scenes/InnerScene.cs | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/Environment/PermissionManager.cs b/OpenSim/Region/Environment/PermissionManager.cs index 3d008a78f8..a6acca75aa 100644 --- a/OpenSim/Region/Environment/PermissionManager.cs +++ b/OpenSim/Region/Environment/PermissionManager.cs @@ -405,6 +405,40 @@ namespace OpenSim.Region.Environment permission = false; } + else + { + bool locked = false; + if (!m_scene.Entities.ContainsKey(obj)) + { + return false; + } + + // If it's not an object, we cant edit it. + if ((!(m_scene.Entities[obj] is SceneObjectGroup))) + { + return false; + } + + + SceneObjectGroup group = (SceneObjectGroup)m_scene.Entities[obj]; + + LLUUID objectOwner = group.OwnerID; + locked = ((group.RootPart.OwnerMask & PERM_LOCKED) == 0); + + + // This is an exception to the generic object permission. + // Administrators who lock their objects should not be able to move them, + // however generic object permission should return true. + // This keeps locked objects from being affected by random click + drag actions by accident + // and allows the administrator to grab or delete a locked object. + + // Administrators and estate managers are still able to click+grab locked objects not + // owned by them in the scene + // This is by design. + + if (locked && (user == objectOwner)) + return false; + } return permission; } diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index a041a529ec..f37d28a5b6 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs @@ -998,7 +998,7 @@ namespace OpenSim.Region.Environment.Scenes SceneObjectGroup group = GetGroupByPrim(objectID); if (group != null) { - if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID)) + if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID))// && PermissionsMngr.) { group.GrabMovement(offset, pos, remoteClient); }