aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorDr Scofield2008-11-14 13:03:18 +0000
committerDr Scofield2008-11-14 13:03:18 +0000
commit5c21ec6d108313080ccf8bdf2212ce52ad80bbb5 (patch)
tree8d039bfe8603ce2c049a8f26f44fa121ab372afe /OpenSim
parentFrom: Christopher Yeoh <cyeoh@au1.ibm.com> (diff)
downloadopensim-SC-5c21ec6d108313080ccf8bdf2212ce52ad80bbb5.zip
opensim-SC-5c21ec6d108313080ccf8bdf2212ce52ad80bbb5.tar.gz
opensim-SC-5c21ec6d108313080ccf8bdf2212ce52ad80bbb5.tar.bz2
opensim-SC-5c21ec6d108313080ccf8bdf2212ce52ad80bbb5.tar.xz
reverting #7295, as it still fails a test case (as pointed out very
kindly by sean) --- lesson learned: just running a "make test" is not sufficient, you need to precede it by a "make clean".
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Data/Tests/BasicRegionTest.cs6
-rw-r--r--OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs18
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs35
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs18
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs3
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs2
7 files changed, 24 insertions, 60 deletions
diff --git a/OpenSim/Data/Tests/BasicRegionTest.cs b/OpenSim/Data/Tests/BasicRegionTest.cs
index ec64b77..ab46ed4 100644
--- a/OpenSim/Data/Tests/BasicRegionTest.cs
+++ b/OpenSim/Data/Tests/BasicRegionTest.cs
@@ -591,9 +591,7 @@ namespace OpenSim.Data.Tests
591 Assert.That(t.ItemID,Is.EqualTo(id)); 591 Assert.That(t.ItemID,Is.EqualTo(id));
592 Assert.That(t.LastOwnerID, Is.EqualTo(sog.RootPart.LastOwnerID)); 592 Assert.That(t.LastOwnerID, Is.EqualTo(sog.RootPart.LastOwnerID));
593 Assert.That(t.NextPermissions, Is.EqualTo(nextperm)); 593 Assert.That(t.NextPermissions, Is.EqualTo(nextperm));
594 // Ownership changes when you drop an object into an object 594 Assert.That(t.OwnerID,Is.EqualTo(owner));
595 // owned by someone else
596 Assert.That(t.OwnerID,Is.EqualTo(sog.RootPart.OwnerID));
597 Assert.That(t.CurrentPermissions, Is.EqualTo(curperm)); 595 Assert.That(t.CurrentPermissions, Is.EqualTo(curperm));
598 Assert.That(t.ParentID,Is.EqualTo(sog.RootPart.FolderID)); 596 Assert.That(t.ParentID,Is.EqualTo(sog.RootPart.FolderID));
599 Assert.That(t.ParentPartID,Is.EqualTo(sog.RootPart.UUID)); 597 Assert.That(t.ParentPartID,Is.EqualTo(sog.RootPart.UUID));
@@ -850,4 +848,4 @@ namespace OpenSim.Data.Tests
850// return f; 848// return f;
851// } 849// }
852 } 850 }
853} 851} \ No newline at end of file
diff --git a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs
index c5a9066..87348fc 100644
--- a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs
@@ -277,7 +277,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
277 277
278 public bool PropagatePermissions() 278 public bool PropagatePermissions()
279 { 279 {
280 return !m_bypassPermissions; 280 return false;
281 } 281 }
282 282
283 public bool BypassPermissions() 283 public bool BypassPermissions()
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index 590bea0..12095e5 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -1179,8 +1179,7 @@ namespace OpenSim.Region.Environment.Scenes
1179 destTaskItem.InvType = srcTaskItem.InvType; 1179 destTaskItem.InvType = srcTaskItem.InvType;
1180 destTaskItem.Type = srcTaskItem.Type; 1180 destTaskItem.Type = srcTaskItem.Type;
1181 1181
1182 destPart.AddInventoryItem(destTaskItem, part.OwnerID!=destPart.OwnerID 1182 destPart.AddInventoryItem(destTaskItem);
1183 && ExternalChecks.ExternalChecksPropagatePermissions());
1184 1183
1185 if ((srcTaskItem.CurrentPermissions & (uint)PermissionMask.Copy) == 0) 1184 if ((srcTaskItem.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
1186 part.RemoveInventoryItem(itemId); 1185 part.RemoveInventoryItem(itemId);
@@ -1250,16 +1249,11 @@ namespace OpenSim.Region.Environment.Scenes
1250 1249
1251 if (part != null) 1250 if (part != null)
1252 { 1251 {
1253 TaskInventoryItem currentItem = part.GetInventoryItem(itemID); 1252 if (!ExternalChecks.ExternalChecksCanEditObjectInventory(part.UUID, remoteClient.AgentId))
1254 bool allowInventoryDrop = (part.GetEffectiveObjectFlags()
1255 & (uint)PrimFlags.AllowInventoryDrop) != 0;
1256 // Explicity allow anyone to add to the inventory if the AllowInventoryDrop
1257 // flag has been set. Don't however let them update an item unless
1258 // they pass the external checks
1259 if (!ExternalChecks.ExternalChecksCanEditObjectInventory(part.UUID, remoteClient.AgentId)
1260 && (currentItem != null || !allowInventoryDrop ))
1261 return; 1253 return;
1262 1254
1255 TaskInventoryItem currentItem = part.GetInventoryItem(itemID);
1256
1263 if (currentItem == null) 1257 if (currentItem == null)
1264 { 1258 {
1265 UUID copyID = UUID.Random(); 1259 UUID copyID = UUID.Random();
@@ -1423,7 +1417,7 @@ namespace OpenSim.Region.Environment.Scenes
1423 taskItem.PermsMask = 0; 1417 taskItem.PermsMask = 0;
1424 taskItem.AssetID = asset.FullID; 1418 taskItem.AssetID = asset.FullID;
1425 1419
1426 part.AddInventoryItem(taskItem, false); 1420 part.AddInventoryItem(taskItem);
1427 part.GetProperties(remoteClient); 1421 part.GetProperties(remoteClient);
1428 1422
1429 part.CreateScriptInstance(taskItem, 0, false, DefaultScriptEngine, 0); 1423 part.CreateScriptInstance(taskItem, 0, false, DefaultScriptEngine, 0);
@@ -1518,7 +1512,7 @@ namespace OpenSim.Region.Environment.Scenes
1518 destTaskItem.InvType = srcTaskItem.InvType; 1512 destTaskItem.InvType = srcTaskItem.InvType;
1519 destTaskItem.Type = srcTaskItem.Type; 1513 destTaskItem.Type = srcTaskItem.Type;
1520 1514
1521 destPart.AddInventoryItemExclusive(destTaskItem, false); 1515 destPart.AddInventoryItemExclusive(destTaskItem);
1522 1516
1523 if (running > 0) 1517 if (running > 0)
1524 { 1518 {
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
index 8275ceb..bfa9763 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
@@ -151,42 +151,23 @@ namespace OpenSim.Region.Environment.Scenes
151 taskItem.AssetID = item.AssetID; 151 taskItem.AssetID = item.AssetID;
152 taskItem.Name = item.Name; 152 taskItem.Name = item.Name;
153 taskItem.Description = item.Description; 153 taskItem.Description = item.Description;
154 taskItem.OwnerID = part.OwnerID; // Transfer ownership 154 taskItem.OwnerID = item.Owner;
155 taskItem.CreatorID = item.Creator; 155 taskItem.CreatorID = item.Creator;
156 taskItem.Type = item.AssetType; 156 taskItem.Type = item.AssetType;
157 taskItem.InvType = item.InvType; 157 taskItem.InvType = item.InvType;
158 158
159 if (remoteClient!=null && remoteClient.AgentId!=part.OwnerID && 159 taskItem.BasePermissions = item.BasePermissions;
160 m_scene.ExternalChecks.ExternalChecksPropagatePermissions()) { 160 taskItem.CurrentPermissions = item.CurrentPermissions;
161 taskItem.BasePermissions = item.BasePermissions & item.NextPermissions; 161 // FIXME: ignoring group permissions for now as they aren't stored in item
162 taskItem.CurrentPermissions = item.CurrentPermissions & item.NextPermissions; 162 taskItem.EveryonePermissions = item.EveryOnePermissions;
163 taskItem.EveryonePermissions = item.EveryOnePermissions & item.NextPermissions; 163 taskItem.NextPermissions = item.NextPermissions;
164 taskItem.NextPermissions = item.NextPermissions;
165 taskItem.CurrentPermissions |= 8;
166 } else {
167 taskItem.BasePermissions = item.BasePermissions;
168 taskItem.CurrentPermissions = item.CurrentPermissions;
169 taskItem.CurrentPermissions |= 8;
170 taskItem.EveryonePermissions = item.EveryOnePermissions;
171 taskItem.NextPermissions = item.NextPermissions;
172 }
173
174
175
176 taskItem.Flags = item.Flags; 164 taskItem.Flags = item.Flags;
177 // TODO: These are pending addition of those fields to TaskInventoryItem 165 // TODO: These are pending addition of those fields to TaskInventoryItem
178// taskItem.SalePrice = item.SalePrice; 166// taskItem.SalePrice = item.SalePrice;
179// taskItem.SaleType = item.SaleType; 167// taskItem.SaleType = item.SaleType;
180 taskItem.CreationDate = (uint)item.CreationDate; 168 taskItem.CreationDate = (uint)item.CreationDate;
181 169
182 bool addFromAllowedDrop = false; 170 part.AddInventoryItem(taskItem);
183 if (remoteClient!=null)
184 {
185 addFromAllowedDrop = remoteClient.AgentId!=part.OwnerID &&
186 m_scene.ExternalChecks.ExternalChecksPropagatePermissions();
187 }
188
189 part.AddInventoryItem(taskItem, addFromAllowedDrop);
190 171
191 return true; 172 return true;
192 } 173 }
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
index fa66515..501f199 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
@@ -289,16 +289,16 @@ namespace OpenSim.Region.Environment.Scenes
289 /// name is chosen. 289 /// name is chosen.
290 /// </summary> 290 /// </summary>
291 /// <param name="item"></param> 291 /// <param name="item"></param>
292 public void AddInventoryItem(TaskInventoryItem item, bool allowedDrop) 292 public void AddInventoryItem(TaskInventoryItem item)
293 { 293 {
294 AddInventoryItem(item.Name, item, allowedDrop); 294 AddInventoryItem(item.Name, item);
295 } 295 }
296 296
297 /// <summary> 297 /// <summary>
298 /// Add an item to this prim's inventory. If an item with the same name already exists, it is replaced. 298 /// Add an item to this prim's inventory. If an item with the same name already exists, it is replaced.
299 /// </summary> 299 /// </summary>
300 /// <param name="item"></param> 300 /// <param name="item"></param>
301 public void AddInventoryItemExclusive(TaskInventoryItem item, bool allowedDrop) 301 public void AddInventoryItemExclusive(TaskInventoryItem item)
302 { 302 {
303 List<TaskInventoryItem> il = new List<TaskInventoryItem>(m_taskInventory.Values); 303 List<TaskInventoryItem> il = new List<TaskInventoryItem>(m_taskInventory.Values);
304 foreach (TaskInventoryItem i in il) 304 foreach (TaskInventoryItem i in il)
@@ -313,7 +313,7 @@ namespace OpenSim.Region.Environment.Scenes
313 } 313 }
314 } 314 }
315 315
316 AddInventoryItem(item.Name, item, allowedDrop); 316 AddInventoryItem(item.Name, item);
317 } 317 }
318 318
319 /// <summary> 319 /// <summary>
@@ -324,10 +324,7 @@ namespace OpenSim.Region.Environment.Scenes
324 /// The item itself. The name within this structure is ignored in favour of the name 324 /// The item itself. The name within this structure is ignored in favour of the name
325 /// given in this method's arguments 325 /// given in this method's arguments
326 /// </param> 326 /// </param>
327 /// <param name="allowedDrop"> 327 protected void AddInventoryItem(string name, TaskInventoryItem item)
328 // Item was only added to inventory because AllowedDrop is set
329 /// </param>
330 protected void AddInventoryItem(string name, TaskInventoryItem item, bool allowedDrop)
331 { 328 {
332 name = FindAvailableInventoryName(name); 329 name = FindAvailableInventoryName(name);
333 if (name == String.Empty) 330 if (name == String.Empty)
@@ -340,10 +337,7 @@ namespace OpenSim.Region.Environment.Scenes
340 lock (m_taskInventory) 337 lock (m_taskInventory)
341 { 338 {
342 m_taskInventory.Add(item.ItemID, item); 339 m_taskInventory.Add(item.ItemID, item);
343 if (allowedDrop) 340 TriggerScriptChangedEvent(Changed.INVENTORY);
344 TriggerScriptChangedEvent(Changed.ALLOWED_DROP);
345 else
346 TriggerScriptChangedEvent(Changed.INVENTORY);
347 } 341 }
348 342
349 m_inventorySerial++; 343 m_inventorySerial++;
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index c1d718e..ab7b710 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -4006,9 +4006,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4006 m_host.ParentGroup.RootPart.AllowedDrop = true; 4006 m_host.ParentGroup.RootPart.AllowedDrop = true;
4007 else 4007 else
4008 m_host.ParentGroup.RootPart.AllowedDrop = false; 4008 m_host.ParentGroup.RootPart.AllowedDrop = false;
4009
4010 // Update the object flags
4011 m_host.ParentGroup.RootPart.aggregateScriptEvents();
4012 } 4009 }
4013 4010
4014 public LSL_Vector llGetSunDirection() 4011 public LSL_Vector llGetSunDirection()
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 8cac070..f9302e9 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -1014,7 +1014,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1014 taskItem.PermsMask = 0; 1014 taskItem.PermsMask = 0;
1015 taskItem.AssetID = asset.FullID; 1015 taskItem.AssetID = asset.FullID;
1016 1016
1017 m_host.AddInventoryItem(taskItem, false); 1017 m_host.AddInventoryItem(taskItem);
1018 } 1018 }
1019 } 1019 }
1020} 1020}