diff options
author | Dr Scofield | 2008-11-14 13:03:18 +0000 |
---|---|---|
committer | Dr Scofield | 2008-11-14 13:03:18 +0000 |
commit | 5c21ec6d108313080ccf8bdf2212ce52ad80bbb5 (patch) | |
tree | 8d039bfe8603ce2c049a8f26f44fa121ab372afe /OpenSim/Region/Environment | |
parent | From: Christopher Yeoh <cyeoh@au1.ibm.com> (diff) | |
download | opensim-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/Region/Environment')
4 files changed, 21 insertions, 52 deletions
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++; |