diff options
author | Justin Clark-Casey (justincc) | 2012-02-21 22:54:30 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-02-21 22:54:30 +0000 |
commit | 5397a6d4c626818af9aed1e2e0dedd430fb4b948 (patch) | |
tree | 42b1cb15aa18d8db51b0334c6911fdbfc869ddaf /OpenSim/Region | |
parent | Revert "Fix:Cannot drag inventory from child prim into inventory http://opens... (diff) | |
download | opensim-SC-5397a6d4c626818af9aed1e2e0dedd430fb4b948.zip opensim-SC-5397a6d4c626818af9aed1e2e0dedd430fb4b948.tar.gz opensim-SC-5397a6d4c626818af9aed1e2e0dedd430fb4b948.tar.bz2 opensim-SC-5397a6d4c626818af9aed1e2e0dedd430fb4b948.tar.xz |
Fix problem with dragging child part inventory item to user inventory.
This fixes the problem by fixing the permissions module to look at root part permissions rather than having to do this for every caller.
Resolves http://opensimulator.org/mantis/view.php?id=5569
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | 22 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 12 |
2 files changed, 4 insertions, 30 deletions
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index f3c6a30..7023984 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |||
@@ -677,18 +677,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
677 | bool permission = false; | 677 | bool permission = false; |
678 | bool locked = false; | 678 | bool locked = false; |
679 | 679 | ||
680 | if (!m_scene.Entities.ContainsKey(objId)) | 680 | SceneObjectPart part = m_scene.GetSceneObjectPart(objId); |
681 | { | ||
682 | return false; | ||
683 | } | ||
684 | 681 | ||
685 | // If it's not an object, we cant edit it. | 682 | if (part == null) |
686 | if ((!(m_scene.Entities[objId] is SceneObjectGroup))) | ||
687 | { | ||
688 | return false; | 683 | return false; |
689 | } | ||
690 | 684 | ||
691 | SceneObjectGroup group = (SceneObjectGroup)m_scene.Entities[objId]; | 685 | SceneObjectGroup group = part.ParentGroup; |
692 | 686 | ||
693 | UUID objectOwner = group.OwnerID; | 687 | UUID objectOwner = group.OwnerID; |
694 | locked = ((group.RootPart.OwnerMask & PERM_LOCKED) == 0); | 688 | locked = ((group.RootPart.OwnerMask & PERM_LOCKED) == 0); |
@@ -977,16 +971,6 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
977 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 971 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
978 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 972 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
979 | 973 | ||
980 | SceneObjectPart part = m_scene.GetSceneObjectPart(objectID); | ||
981 | |||
982 | // If we selected a sub-prim to edit, the objectID won't represent the object, but only a part. | ||
983 | // We have to check the permissions of the group, though. | ||
984 | if (part.ParentID != 0) | ||
985 | { | ||
986 | objectID = part.ParentUUID; | ||
987 | part = m_scene.GetSceneObjectPart(objectID); | ||
988 | } | ||
989 | |||
990 | return GenericObjectPermission(editorID, objectID, false); | 974 | return GenericObjectPermission(editorID, objectID, false); |
991 | } | 975 | } |
992 | 976 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 6cc78b8..83e3a45 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -1146,17 +1146,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1146 | 1146 | ||
1147 | TaskInventoryItem taskItem = part.Inventory.GetInventoryItem(itemId); | 1147 | TaskInventoryItem taskItem = part.Inventory.GetInventoryItem(itemId); |
1148 | 1148 | ||
1149 | if (null == taskItem) | 1149 | if ((taskItem.CurrentPermissions & (uint)PermissionMask.Copy) == 0) |
1150 | { | ||
1151 | m_log.WarnFormat("[PRIM INVENTORY]: Move of inventory item {0} from prim with local id {1} failed" | ||
1152 | + " because the inventory item could not be found", | ||
1153 | itemId, primLocalId); | ||
1154 | |||
1155 | return; | ||
1156 | } | ||
1157 | |||
1158 | TaskInventoryItem item = part.Inventory.GetInventoryItem(itemId); | ||
1159 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) | ||
1160 | { | 1150 | { |
1161 | // If the item to be moved is no copy, we need to be able to | 1151 | // If the item to be moved is no copy, we need to be able to |
1162 | // edit the prim. | 1152 | // edit the prim. |