aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
Diffstat (limited to '')
-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
4 files changed, 52 insertions, 21 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs
index 87348fc..c5a9066 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 false; 280 return !m_bypassPermissions;
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 12095e5..590bea0 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -1179,7 +1179,8 @@ 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); 1182 destPart.AddInventoryItem(destTaskItem, part.OwnerID!=destPart.OwnerID
1183 && ExternalChecks.ExternalChecksPropagatePermissions());
1183 1184
1184 if ((srcTaskItem.CurrentPermissions & (uint)PermissionMask.Copy) == 0) 1185 if ((srcTaskItem.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
1185 part.RemoveInventoryItem(itemId); 1186 part.RemoveInventoryItem(itemId);
@@ -1249,10 +1250,15 @@ namespace OpenSim.Region.Environment.Scenes
1249 1250
1250 if (part != null) 1251 if (part != null)
1251 { 1252 {
1252 if (!ExternalChecks.ExternalChecksCanEditObjectInventory(part.UUID, remoteClient.AgentId))
1253 return;
1254
1255 TaskInventoryItem currentItem = part.GetInventoryItem(itemID); 1253 TaskInventoryItem currentItem = part.GetInventoryItem(itemID);
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;
1256 1262
1257 if (currentItem == null) 1263 if (currentItem == null)
1258 { 1264 {
@@ -1417,7 +1423,7 @@ namespace OpenSim.Region.Environment.Scenes
1417 taskItem.PermsMask = 0; 1423 taskItem.PermsMask = 0;
1418 taskItem.AssetID = asset.FullID; 1424 taskItem.AssetID = asset.FullID;
1419 1425
1420 part.AddInventoryItem(taskItem); 1426 part.AddInventoryItem(taskItem, false);
1421 part.GetProperties(remoteClient); 1427 part.GetProperties(remoteClient);
1422 1428
1423 part.CreateScriptInstance(taskItem, 0, false, DefaultScriptEngine, 0); 1429 part.CreateScriptInstance(taskItem, 0, false, DefaultScriptEngine, 0);
@@ -1512,7 +1518,7 @@ namespace OpenSim.Region.Environment.Scenes
1512 destTaskItem.InvType = srcTaskItem.InvType; 1518 destTaskItem.InvType = srcTaskItem.InvType;
1513 destTaskItem.Type = srcTaskItem.Type; 1519 destTaskItem.Type = srcTaskItem.Type;
1514 1520
1515 destPart.AddInventoryItemExclusive(destTaskItem); 1521 destPart.AddInventoryItemExclusive(destTaskItem, false);
1516 1522
1517 if (running > 0) 1523 if (running > 0)
1518 { 1524 {
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
index bfa9763..8275ceb 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
@@ -151,23 +151,42 @@ 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 = item.Owner; 154 taskItem.OwnerID = part.OwnerID; // Transfer ownership
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 taskItem.BasePermissions = item.BasePermissions; 159 if (remoteClient!=null && remoteClient.AgentId!=part.OwnerID &&
160 taskItem.CurrentPermissions = item.CurrentPermissions; 160 m_scene.ExternalChecks.ExternalChecksPropagatePermissions()) {
161 // FIXME: ignoring group permissions for now as they aren't stored in item 161 taskItem.BasePermissions = item.BasePermissions & item.NextPermissions;
162 taskItem.EveryonePermissions = item.EveryOnePermissions; 162 taskItem.CurrentPermissions = item.CurrentPermissions & item.NextPermissions;
163 taskItem.NextPermissions = item.NextPermissions; 163 taskItem.EveryonePermissions = item.EveryOnePermissions & 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
164 taskItem.Flags = item.Flags; 176 taskItem.Flags = item.Flags;
165 // TODO: These are pending addition of those fields to TaskInventoryItem 177 // TODO: These are pending addition of those fields to TaskInventoryItem
166// taskItem.SalePrice = item.SalePrice; 178// taskItem.SalePrice = item.SalePrice;
167// taskItem.SaleType = item.SaleType; 179// taskItem.SaleType = item.SaleType;
168 taskItem.CreationDate = (uint)item.CreationDate; 180 taskItem.CreationDate = (uint)item.CreationDate;
169 181
170 part.AddInventoryItem(taskItem); 182 bool addFromAllowedDrop = false;
183 if (remoteClient!=null)
184 {
185 addFromAllowedDrop = remoteClient.AgentId!=part.OwnerID &&
186 m_scene.ExternalChecks.ExternalChecksPropagatePermissions();
187 }
188
189 part.AddInventoryItem(taskItem, addFromAllowedDrop);
171 190
172 return true; 191 return true;
173 } 192 }
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
index 501f199..fa66515 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) 292 public void AddInventoryItem(TaskInventoryItem item, bool allowedDrop)
293 { 293 {
294 AddInventoryItem(item.Name, item); 294 AddInventoryItem(item.Name, item, allowedDrop);
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) 301 public void AddInventoryItemExclusive(TaskInventoryItem item, bool allowedDrop)
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); 316 AddInventoryItem(item.Name, item, allowedDrop);
317 } 317 }
318 318
319 /// <summary> 319 /// <summary>
@@ -324,7 +324,10 @@ 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 protected void AddInventoryItem(string name, TaskInventoryItem item) 327 /// <param name="allowedDrop">
328 // Item was only added to inventory because AllowedDrop is set
329 /// </param>
330 protected void AddInventoryItem(string name, TaskInventoryItem item, bool allowedDrop)
328 { 331 {
329 name = FindAvailableInventoryName(name); 332 name = FindAvailableInventoryName(name);
330 if (name == String.Empty) 333 if (name == String.Empty)
@@ -337,7 +340,10 @@ namespace OpenSim.Region.Environment.Scenes
337 lock (m_taskInventory) 340 lock (m_taskInventory)
338 { 341 {
339 m_taskInventory.Add(item.ItemID, item); 342 m_taskInventory.Add(item.ItemID, item);
340 TriggerScriptChangedEvent(Changed.INVENTORY); 343 if (allowedDrop)
344 TriggerScriptChangedEvent(Changed.ALLOWED_DROP);
345 else
346 TriggerScriptChangedEvent(Changed.INVENTORY);
341 } 347 }
342 348
343 m_inventorySerial++; 349 m_inventorySerial++;