aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
diff options
context:
space:
mode:
authorMelanie2011-01-12 16:20:38 +0100
committerMelanie2011-01-12 16:20:38 +0100
commit7f99a8c900251c59bc7cb7d8309a14ad5360de42 (patch)
tree3859626c6eb4f2f8d05fcbc7f0a7c270671fcecd /OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
parentRemove old guids from the examples, for completeness' sake (diff)
downloadopensim-SC-7f99a8c900251c59bc7cb7d8309a14ad5360de42.zip
opensim-SC-7f99a8c900251c59bc7cb7d8309a14ad5360de42.tar.gz
opensim-SC-7f99a8c900251c59bc7cb7d8309a14ad5360de42.tar.bz2
opensim-SC-7f99a8c900251c59bc7cb7d8309a14ad5360de42.tar.xz
Fix direct item give permissions
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs44
1 files changed, 39 insertions, 5 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 1f32362..7216b39 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -308,10 +308,17 @@ namespace OpenSim.Region.Framework.Scenes
308 { 308 {
309 if (UUID.Zero == transactionID) 309 if (UUID.Zero == transactionID)
310 { 310 {
311 item.Flags = itemUpd.Flags;
311 item.Name = itemUpd.Name; 312 item.Name = itemUpd.Name;
312 item.Description = itemUpd.Description; 313 item.Description = itemUpd.Description;
314 if (item.NextPermissions != (itemUpd.NextPermissions & item.BasePermissions))
315 item.Flags |= (uint)InventoryItemFlags.ObjectOverwriteNextOwner;
313 item.NextPermissions = itemUpd.NextPermissions & item.BasePermissions; 316 item.NextPermissions = itemUpd.NextPermissions & item.BasePermissions;
317 if (item.EveryOnePermissions != (itemUpd.EveryOnePermissions & item.BasePermissions))
318 item.Flags |= (uint)InventoryItemFlags.ObjectOverwriteEveryone;
314 item.EveryOnePermissions = itemUpd.EveryOnePermissions & item.BasePermissions; 319 item.EveryOnePermissions = itemUpd.EveryOnePermissions & item.BasePermissions;
320 if (item.GroupPermissions != (itemUpd.GroupPermissions & item.BasePermissions))
321 item.Flags |= (uint)InventoryItemFlags.ObjectOverwriteGroup;
315 item.GroupPermissions = itemUpd.GroupPermissions & item.BasePermissions; 322 item.GroupPermissions = itemUpd.GroupPermissions & item.BasePermissions;
316 item.GroupID = itemUpd.GroupID; 323 item.GroupID = itemUpd.GroupID;
317 item.GroupOwned = itemUpd.GroupOwned; 324 item.GroupOwned = itemUpd.GroupOwned;
@@ -326,9 +333,12 @@ namespace OpenSim.Region.Framework.Scenes
326 // TODO: Check if folder changed and move item 333 // TODO: Check if folder changed and move item
327 //item.NextPermissions = itemUpd.Folder; 334 //item.NextPermissions = itemUpd.Folder;
328 item.InvType = itemUpd.InvType; 335 item.InvType = itemUpd.InvType;
336
337 if (item.SalePrice != itemUpd.SalePrice ||
338 item.SaleType != itemUpd.SaleType)
339 item.Flags |= (uint)InventoryItemFlags.ObjectSlamSale;
329 item.SalePrice = itemUpd.SalePrice; 340 item.SalePrice = itemUpd.SalePrice;
330 item.SaleType = itemUpd.SaleType; 341 item.SaleType = itemUpd.SaleType;
331 item.Flags = itemUpd.Flags;
332 342
333 InventoryService.UpdateItem(item); 343 InventoryService.UpdateItem(item);
334 } 344 }
@@ -509,7 +519,8 @@ namespace OpenSim.Region.Framework.Scenes
509 // Assign to the actual item. Make sure the slam bit is 519 // Assign to the actual item. Make sure the slam bit is
510 // set, if it wasn't set before. 520 // set, if it wasn't set before.
511 itemCopy.BasePermissions = basePerms; 521 itemCopy.BasePermissions = basePerms;
512 itemCopy.CurrentPermissions = ownerPerms | 16; // Slam 522 itemCopy.CurrentPermissions = ownerPerms;
523 itemCopy.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
513 524
514 itemCopy.NextPermissions = item.NextPermissions; 525 itemCopy.NextPermissions = item.NextPermissions;
515 526
@@ -1049,7 +1060,7 @@ namespace OpenSim.Region.Framework.Scenes
1049 else 1060 else
1050 agentItem.CurrentPermissions = agentItem.BasePermissions & taskItem.CurrentPermissions; 1061 agentItem.CurrentPermissions = agentItem.BasePermissions & taskItem.CurrentPermissions;
1051 1062
1052 agentItem.CurrentPermissions |= 16; // Slam 1063 agentItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
1053 agentItem.NextPermissions = taskItem.NextPermissions; 1064 agentItem.NextPermissions = taskItem.NextPermissions;
1054 agentItem.EveryOnePermissions = taskItem.EveryonePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move); 1065 agentItem.EveryOnePermissions = taskItem.EveryonePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move);
1055 agentItem.GroupPermissions = taskItem.GroupPermissions & taskItem.NextPermissions; 1066 agentItem.GroupPermissions = taskItem.GroupPermissions & taskItem.NextPermissions;
@@ -1260,7 +1271,7 @@ namespace OpenSim.Region.Framework.Scenes
1260 (srcTaskItem.NextPermissions | (uint)PermissionMask.Move); 1271 (srcTaskItem.NextPermissions | (uint)PermissionMask.Move);
1261 destTaskItem.BasePermissions = srcTaskItem.BasePermissions & 1272 destTaskItem.BasePermissions = srcTaskItem.BasePermissions &
1262 (srcTaskItem.NextPermissions | (uint)PermissionMask.Move); 1273 (srcTaskItem.NextPermissions | (uint)PermissionMask.Move);
1263 destTaskItem.CurrentPermissions |= 16; // Slam! 1274 destTaskItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
1264 } 1275 }
1265 } 1276 }
1266 1277
@@ -1434,6 +1445,8 @@ namespace OpenSim.Region.Framework.Scenes
1434 // Base ALWAYS has move 1445 // Base ALWAYS has move
1435 currentItem.BasePermissions |= (uint)PermissionMask.Move; 1446 currentItem.BasePermissions |= (uint)PermissionMask.Move;
1436 1447
1448 itemInfo.Flags = currentItem.Flags;
1449
1437 // Check if we're allowed to mess with permissions 1450 // Check if we're allowed to mess with permissions
1438 if (!Permissions.IsGod(remoteClient.AgentId)) // Not a god 1451 if (!Permissions.IsGod(remoteClient.AgentId)) // Not a god
1439 { 1452 {
@@ -1451,6 +1464,14 @@ namespace OpenSim.Region.Framework.Scenes
1451 // Owner can't change base, and can change other 1464 // Owner can't change base, and can change other
1452 // only up to base 1465 // only up to base
1453 itemInfo.BasePermissions = currentItem.BasePermissions; 1466 itemInfo.BasePermissions = currentItem.BasePermissions;
1467 if (itemInfo.EveryonePermissions != currentItem.EveryonePermissions)
1468 itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteEveryone;
1469 if (itemInfo.GroupPermissions != currentItem.GroupPermissions)
1470 itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteGroup;
1471 if (itemInfo.CurrentPermissions != currentItem.CurrentPermissions)
1472 itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteOwner;
1473 if (itemInfo.NextPermissions != currentItem.NextPermissions)
1474 itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteNextOwner;
1454 itemInfo.EveryonePermissions &= currentItem.BasePermissions; 1475 itemInfo.EveryonePermissions &= currentItem.BasePermissions;
1455 itemInfo.GroupPermissions &= currentItem.BasePermissions; 1476 itemInfo.GroupPermissions &= currentItem.BasePermissions;
1456 itemInfo.CurrentPermissions &= currentItem.BasePermissions; 1477 itemInfo.CurrentPermissions &= currentItem.BasePermissions;
@@ -1458,6 +1479,19 @@ namespace OpenSim.Region.Framework.Scenes
1458 } 1479 }
1459 1480
1460 } 1481 }
1482 else
1483 {
1484 if (itemInfo.BasePermissions != currentItem.BasePermissions)
1485 itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteBase;
1486 if (itemInfo.EveryonePermissions != currentItem.EveryonePermissions)
1487 itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteEveryone;
1488 if (itemInfo.GroupPermissions != currentItem.GroupPermissions)
1489 itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteGroup;
1490 if (itemInfo.CurrentPermissions != currentItem.CurrentPermissions)
1491 itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteOwner;
1492 if (itemInfo.NextPermissions != currentItem.NextPermissions)
1493 itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteNextOwner;
1494 }
1461 1495
1462 // Next ALWAYS has move 1496 // Next ALWAYS has move
1463 itemInfo.NextPermissions |= (uint)PermissionMask.Move; 1497 itemInfo.NextPermissions |= (uint)PermissionMask.Move;
@@ -1666,7 +1700,7 @@ namespace OpenSim.Region.Framework.Scenes
1666 srcTaskItem.NextPermissions; 1700 srcTaskItem.NextPermissions;
1667 destTaskItem.BasePermissions = srcTaskItem.BasePermissions & 1701 destTaskItem.BasePermissions = srcTaskItem.BasePermissions &
1668 srcTaskItem.NextPermissions; 1702 srcTaskItem.NextPermissions;
1669 destTaskItem.CurrentPermissions |= 16; // Slam! 1703 destTaskItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
1670 } 1704 }
1671 } 1705 }
1672 1706