aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes
diff options
context:
space:
mode:
authorCharles Krinke2008-06-24 23:55:33 +0000
committerCharles Krinke2008-06-24 23:55:33 +0000
commitf6bf4c39be634bb8d1a03de5fd048edc54b7df50 (patch)
treefd178392c1ab29cb7b729a85811c34b7686e5dd2 /OpenSim/Region/Environment/Scenes
parentMantis#5189. Thank you kindly, Matth for your patch (diff)
downloadopensim-SC-f6bf4c39be634bb8d1a03de5fd048edc54b7df50.zip
opensim-SC-f6bf4c39be634bb8d1a03de5fd048edc54b7df50.tar.gz
opensim-SC-f6bf4c39be634bb8d1a03de5fd048edc54b7df50.tar.bz2
opensim-SC-f6bf4c39be634bb8d1a03de5fd048edc54b7df50.tar.xz
Mantis#1587. Thank you kindly, Melanie for a patch that:
Add permissions magling to llGiveInventoryItem, correct some corner case functionality
Diffstat (limited to 'OpenSim/Region/Environment/Scenes')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs49
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs4
2 files changed, 38 insertions, 15 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index 3580b99..517066d 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -882,12 +882,6 @@ namespace OpenSim.Region.Environment.Scenes
882 return; 882 return;
883 } 883 }
884 884
885 // Only owner can copy
886 if (remoteClient.AgentId != taskItem.OwnerID)
887 {
888 return;
889 }
890
891 InventoryItemBase agentItem = new InventoryItemBase(); 885 InventoryItemBase agentItem = new InventoryItemBase();
892 886
893 agentItem.ID = LLUUID.Random(); 887 agentItem.ID = LLUUID.Random();
@@ -925,13 +919,13 @@ namespace OpenSim.Region.Environment.Scenes
925 } 919 }
926 920
927 /// <summary> 921 /// <summary>
928 /// <see>MoveTaskInventoryItem</see> 922 /// <see>ClientMoveTaskInventoryItem</see>
929 /// </summary> 923 /// </summary>
930 /// <param name="remoteClient"></param> 924 /// <param name="remoteClient"></param>
931 /// <param name="folderID"></param> 925 /// <param name="folderID"></param>
932 /// <param name="primLocalID"></param> 926 /// <param name="primLocalID"></param>
933 /// <param name="itemID"></param> 927 /// <param name="itemID"></param>
934 public void MoveTaskInventoryItem(IClientAPI remoteClient, LLUUID folderId, uint primLocalId, LLUUID itemId) 928 public void ClientMoveTaskInventoryItem(IClientAPI remoteClient, LLUUID folderId, uint primLocalId, LLUUID itemId)
935 { 929 {
936 SceneObjectPart part = GetSceneObjectPart(primLocalId); 930 SceneObjectPart part = GetSceneObjectPart(primLocalId);
937 931
@@ -944,6 +938,15 @@ namespace OpenSim.Region.Environment.Scenes
944 938
945 return; 939 return;
946 } 940 }
941
942 TaskInventoryItem taskItem = part.GetInventoryItem(itemId);
943
944 // Only owner can copy
945 if (remoteClient.AgentId != taskItem.OwnerID)
946 {
947 return;
948 }
949
947 MoveTaskInventoryItem(remoteClient, folderId, part, itemId); 950 MoveTaskInventoryItem(remoteClient, folderId, part, itemId);
948 } 951 }
949 952
@@ -977,7 +980,7 @@ namespace OpenSim.Region.Environment.Scenes
977 /// <param name="destId"></param> 980 /// <param name="destId"></param>
978 /// <param name="part"></param> 981 /// <param name="part"></param>
979 /// <param name="itemId"></param> 982 /// <param name="itemId"></param>
980 public void CopyTaskInventoryItem(LLUUID destId, SceneObjectPart part, LLUUID itemId) 983 public void MoveTaskInventoryItem(LLUUID destId, SceneObjectPart part, LLUUID itemId)
981 { 984 {
982 TaskInventoryItem srcTaskItem = part.GetInventoryItem(itemId); 985 TaskInventoryItem srcTaskItem = part.GetInventoryItem(itemId);
983 986
@@ -1003,23 +1006,43 @@ namespace OpenSim.Region.Environment.Scenes
1003 destTaskItem.ItemID = LLUUID.Random(); 1006 destTaskItem.ItemID = LLUUID.Random();
1004 destTaskItem.CreatorID = srcTaskItem.CreatorID; 1007 destTaskItem.CreatorID = srcTaskItem.CreatorID;
1005 destTaskItem.AssetID = srcTaskItem.AssetID; 1008 destTaskItem.AssetID = srcTaskItem.AssetID;
1006 destTaskItem.GroupID = srcTaskItem.GroupID; 1009 destTaskItem.GroupID = destPart.GroupID;
1007 destTaskItem.OwnerID = srcTaskItem.OwnerID; 1010 destTaskItem.OwnerID = destPart.OwnerID;
1008 destTaskItem.ParentID = srcTaskItem.ParentID; 1011 destTaskItem.ParentID = destPart.UUID;
1009 destTaskItem.ParentPartID = srcTaskItem.ParentPartID; 1012 destTaskItem.ParentPartID = destPart.UUID;
1010 1013
1011 destTaskItem.BaseMask = srcTaskItem.BaseMask; 1014 destTaskItem.BaseMask = srcTaskItem.BaseMask;
1012 destTaskItem.EveryoneMask = srcTaskItem.EveryoneMask; 1015 destTaskItem.EveryoneMask = srcTaskItem.EveryoneMask;
1013 destTaskItem.GroupMask = srcTaskItem.GroupMask; 1016 destTaskItem.GroupMask = srcTaskItem.GroupMask;
1014 destTaskItem.OwnerMask = srcTaskItem.OwnerMask; 1017 destTaskItem.OwnerMask = srcTaskItem.OwnerMask;
1018 destTaskItem.NextOwnerMask = srcTaskItem.NextOwnerMask;
1015 destTaskItem.Flags = srcTaskItem.Flags; 1019 destTaskItem.Flags = srcTaskItem.Flags;
1016 1020
1021 if(destPart.OwnerID != part.OwnerID)
1022 {
1023 if (ExternalChecks.ExternalChecksPropagatePermissions())
1024 {
1025 destTaskItem.OwnerMask = srcTaskItem.OwnerMask &
1026 srcTaskItem.NextOwnerMask;
1027 destTaskItem.GroupMask = srcTaskItem.GroupMask &
1028 srcTaskItem.NextOwnerMask;
1029 destTaskItem.EveryoneMask = srcTaskItem.EveryoneMask &
1030 srcTaskItem.NextOwnerMask;
1031 destTaskItem.BaseMask = srcTaskItem.BaseMask &
1032 srcTaskItem.NextOwnerMask;
1033 destTaskItem.OwnerMask |= 8; // Slam!
1034 }
1035 }
1036
1017 destTaskItem.Description = srcTaskItem.Description; 1037 destTaskItem.Description = srcTaskItem.Description;
1018 destTaskItem.Name = srcTaskItem.Name; 1038 destTaskItem.Name = srcTaskItem.Name;
1019 destTaskItem.InvType = srcTaskItem.InvType; 1039 destTaskItem.InvType = srcTaskItem.InvType;
1020 destTaskItem.Type = srcTaskItem.Type; 1040 destTaskItem.Type = srcTaskItem.Type;
1021 1041
1022 destPart.AddInventoryItem(destTaskItem); 1042 destPart.AddInventoryItem(destTaskItem);
1043
1044 if((srcTaskItem.OwnerMask & (uint)PermissionMask.Copy) == 0)
1045 part.RemoveInventoryItem(itemId);
1023 1046
1024 } 1047 }
1025 1048
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 69981e2..bbef28f 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -2010,7 +2010,7 @@ namespace OpenSim.Region.Environment.Scenes
2010 client.OnRequestTaskInventory += RequestTaskInventory; 2010 client.OnRequestTaskInventory += RequestTaskInventory;
2011 client.OnRemoveTaskItem += RemoveTaskInventory; 2011 client.OnRemoveTaskItem += RemoveTaskInventory;
2012 client.OnUpdateTaskInventory += UpdateTaskInventory; 2012 client.OnUpdateTaskInventory += UpdateTaskInventory;
2013 client.OnMoveTaskItem += MoveTaskInventoryItem; 2013 client.OnMoveTaskItem += ClientMoveTaskInventoryItem;
2014 client.OnGrabObject += ProcessObjectGrab; 2014 client.OnGrabObject += ProcessObjectGrab;
2015 client.OnDeGrabObject += ProcessObjectDeGrab; 2015 client.OnDeGrabObject += ProcessObjectDeGrab;
2016 client.OnMoneyTransferRequest += ProcessMoneyTransferRequest; 2016 client.OnMoneyTransferRequest += ProcessMoneyTransferRequest;
@@ -3628,4 +3628,4 @@ namespace OpenSim.Region.Environment.Scenes
3628 } 3628 }
3629} 3629}
3630 3630
3631 \ No newline at end of file 3631