aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs3
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs73
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs1
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs5
4 files changed, 50 insertions, 32 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs
index a319119..9dcb88c 100644
--- a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs
@@ -301,13 +301,14 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
301 LLObject.ObjectFlags.ObjectMove | // tells client that you can move the object (only, no mod) 301 LLObject.ObjectFlags.ObjectMove | // tells client that you can move the object (only, no mod)
302 LLObject.ObjectFlags.ObjectTransfer | // tells the client that you can /take/ the object if you don't own it 302 LLObject.ObjectFlags.ObjectTransfer | // tells the client that you can /take/ the object if you don't own it
303 LLObject.ObjectFlags.ObjectYouOwner | // Tells client that you're the owner of the object 303 LLObject.ObjectFlags.ObjectYouOwner | // Tells client that you're the owner of the object
304 LLObject.ObjectFlags.ObjectOwnerModify | // Tells client that you're the owner of the object
304 LLObject.ObjectFlags.ObjectYouOfficer // Tells client that you've got group object editing permission. Used when ObjectGroupOwned is set 305 LLObject.ObjectFlags.ObjectYouOfficer // Tells client that you've got group object editing permission. Used when ObjectGroupOwned is set
305 ); 306 );
306 307
307 // Creating the three ObjectFlags options for this method to choose from. 308 // Creating the three ObjectFlags options for this method to choose from.
308 // Customize the OwnerMask 309 // Customize the OwnerMask
309 uint objectOwnerMask = ApplyObjectModifyMasks(task.OwnerMask, objflags); 310 uint objectOwnerMask = ApplyObjectModifyMasks(task.OwnerMask, objflags);
310 objectOwnerMask |= (uint)LLObject.ObjectFlags.ObjectYouOwner; 311 objectOwnerMask |= (uint)LLObject.ObjectFlags.ObjectYouOwner | (uint)LLObject.ObjectFlags.ObjectOwnerModify;
311 312
312 // Customize the GroupMask 313 // Customize the GroupMask
313 uint objectGroupMask = ApplyObjectModifyMasks(task.GroupMask, objflags); 314 uint objectGroupMask = ApplyObjectModifyMasks(task.GroupMask, objflags);
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index 0e19d96..e92178c 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -897,53 +897,66 @@ namespace OpenSim.Region.Environment.Scenes
897 /// This method does not handle scripts, <see>RezScript(IClientAPI, LLUUID, unit)</see> 897 /// This method does not handle scripts, <see>RezScript(IClientAPI, LLUUID, unit)</see>
898 /// </summary> 898 /// </summary>
899 /// <param name="remoteClient"></param> 899 /// <param name="remoteClient"></param>
900 /// <param name="itemID"></param> 900 /// <param name="transactionID"></param>
901 /// <param name="folderID"></param> 901 /// <param name="itemInfo"></param>
902 /// <param name="primLocalID"></param> 902 /// <param name="primLocalID"></param>
903 public void UpdateTaskInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID folderID, 903 public void UpdateTaskInventory(IClientAPI remoteClient, LLUUID transactionID, TaskInventoryItem itemInfo,
904 uint primLocalID) 904 uint primLocalID)
905 { 905 {
906 LLUUID itemID=itemInfo.ItemID;
907 LLUUID folderID=itemInfo.ParentID;
908
909 // Find the prim we're dealing with
906 SceneObjectPart part = GetSceneObjectPart(primLocalID); 910 SceneObjectPart part = GetSceneObjectPart(primLocalID);
907 911
908 if (part != null) 912 if (part != null)
909 { 913 {
910 LLUUID copyID = LLUUID.Random(); 914 TaskInventoryItem currentItem=part.GetInventoryItem(itemID);
911 if (itemID != LLUUID.Zero) 915 if(currentItem == null)
912 { 916 {
913 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 917 LLUUID copyID = LLUUID.Random();
914 918 if (itemID != LLUUID.Zero)
915 if (userInfo != null && userInfo.RootFolder != null)
916 { 919 {
917 InventoryItemBase item = userInfo.RootFolder.FindItem(itemID); 920 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
918 921
919 // Try library 922 if (userInfo != null && userInfo.RootFolder != null)
920 // XXX clumsy, possibly should be one call
921 if (null == item)
922 { 923 {
923 item = CommsManager.UserProfileCacheService.libraryRoot.FindItem(itemID); 924 InventoryItemBase item = userInfo.RootFolder.FindItem(itemID);
924 }
925 925
926 if (item != null) 926 // Try library
927 { 927 // XXX clumsy, possibly should be one call
928 part.ParentGroup.AddInventoryItem(remoteClient, primLocalID, item, copyID); 928 if (null == item)
929 m_log.InfoFormat(
930 "[PRIM INVENTORY]: Update with item {0} requested of prim {1} for {2}",
931 item.Name, primLocalID, remoteClient.Name);
932 part.GetProperties(remoteClient);
933 if (!ExternalChecks.ExternalChecksBypassPermissions())
934 { 929 {
935 if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) 930 item = CommsManager.UserProfileCacheService.libraryRoot.FindItem(itemID);
936 RemoveInventoryItem(remoteClient, itemID); 931 }
932
933 if (item != null)
934 {
935 part.ParentGroup.AddInventoryItem(remoteClient, primLocalID, item, copyID);
936 m_log.InfoFormat(
937 "[PRIM INVENTORY]: Update with item {0} requested of prim {1} for {2}",
938 item.Name, primLocalID, remoteClient.Name);
939 part.GetProperties(remoteClient);
940 if (!ExternalChecks.ExternalChecksBypassPermissions())
941 {
942 if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
943 RemoveInventoryItem(remoteClient, itemID);
944 }
945 }
946 else
947 {
948 m_log.ErrorFormat(
949 "[PRIM INVENTORY]: Could not find inventory item {0} to update for {1}!",
950 itemID, remoteClient.Name);
937 } 951 }
938 }
939 else
940 {
941 m_log.ErrorFormat(
942 "[PRIM INVENTORY]: Could not find inventory item {0} to update for {1}!",
943 itemID, remoteClient.Name);
944 } 952 }
945 } 953 }
946 } 954 }
955 else // Updating existing item with new perms etc
956 {
957 if(part.UpdateInventoryItem(itemInfo))
958 part.GetProperties(remoteClient);
959 }
947 } 960 }
948 else 961 else
949 { 962 {
diff --git a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs
index 040ee70..2be5ab9 100644
--- a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs
@@ -69,6 +69,7 @@ namespace OpenSim.Region.Environment.Scenes
69 (uint)LLObject.ObjectFlags.ObjectMove | 69 (uint)LLObject.ObjectFlags.ObjectMove |
70 (uint)LLObject.ObjectFlags.ObjectTransfer | 70 (uint)LLObject.ObjectFlags.ObjectTransfer |
71 (uint)LLObject.ObjectFlags.ObjectYouOwner | 71 (uint)LLObject.ObjectFlags.ObjectYouOwner |
72 (uint)LLObject.ObjectFlags.ObjectOwnerModify |
72 (uint)LLObject.ObjectFlags.ObjectYouOfficer; 73 (uint)LLObject.ObjectFlags.ObjectYouOfficer;
73 74
74 foreach (GenerateClientFlags check in GenerateClientFlagsCheckFunctions) 75 foreach (GenerateClientFlags check in GenerateClientFlagsCheckFunctions)
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
index 51521ff..facf72d 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
@@ -286,7 +286,6 @@ namespace OpenSim.Region.Environment.Scenes
286 public void AddInventoryItem(TaskInventoryItem item) 286 public void AddInventoryItem(TaskInventoryItem item)
287 { 287 {
288 item.ParentID = UUID; 288 item.ParentID = UUID;
289 item.CreationDate = 1000;
290 item.ParentPartID = UUID; 289 item.ParentPartID = UUID;
291 290
292 string name=FindAvailableInventoryName(item.Name); 291 string name=FindAvailableInventoryName(item.Name);
@@ -369,6 +368,10 @@ namespace OpenSim.Region.Environment.Scenes
369 { 368 {
370 if (m_taskInventory.ContainsKey(item.ItemID)) 369 if (m_taskInventory.ContainsKey(item.ItemID))
371 { 370 {
371 item.ParentID = UUID;
372 item.ParentPartID = UUID;
373 item.Flags=m_taskInventory[item.ItemID].Flags;
374
372 m_taskInventory[item.ItemID] = item; 375 m_taskInventory[item.ItemID] = item;
373 m_inventorySerial++; 376 m_inventorySerial++;
374 TriggerScriptChangedEvent(Changed.INVENTORY); 377 TriggerScriptChangedEvent(Changed.INVENTORY);