diff options
author | Melanie | 2010-07-17 03:18:01 +0100 |
---|---|---|
committer | Melanie | 2010-07-17 03:18:01 +0100 |
commit | 859e3252be87734290c468c04ab13b70808ca708 (patch) | |
tree | 35433df5332b03400c83e1de780005cc609dd521 /OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |
parent | Merge branch 'careminster-presence-refactor' of ssh://melanie@3dhosting.de/va... (diff) | |
parent | Replace the screenful of code i deleted. (diff) | |
download | opensim-SC-859e3252be87734290c468c04ab13b70808ca708.zip opensim-SC-859e3252be87734290c468c04ab13b70808ca708.tar.gz opensim-SC-859e3252be87734290c468c04ab13b70808ca708.tar.bz2 opensim-SC-859e3252be87734290c468c04ab13b70808ca708.tar.xz |
Merge branch 'careminster-presence-refactor' of ssh://melanie@3dhosting.de/var/git/careminster into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 56 |
1 files changed, 50 insertions, 6 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index c77efc7..4575068 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -935,6 +935,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
935 | } | 935 | } |
936 | if (part != null && group != null) | 936 | if (part != null && group != null) |
937 | { | 937 | { |
938 | if (!Permissions.CanEditObjectInventory(part.UUID, remoteClient.AgentId)) | ||
939 | return; | ||
940 | |||
938 | TaskInventoryItem item = group.GetInventoryItem(localID, itemID); | 941 | TaskInventoryItem item = group.GetInventoryItem(localID, itemID); |
939 | if (item == null) | 942 | if (item == null) |
940 | return; | 943 | return; |
@@ -1074,9 +1077,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
1074 | return; | 1077 | return; |
1075 | } | 1078 | } |
1076 | 1079 | ||
1077 | // Only owner can copy | 1080 | TaskInventoryItem item = part.Inventory.GetInventoryItem(itemId); |
1078 | if (remoteClient.AgentId != taskItem.OwnerID) | 1081 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) |
1079 | return; | 1082 | { |
1083 | // If the item to be moved is no copy, we need to be able to | ||
1084 | // edit the prim. | ||
1085 | if (!Permissions.CanEditObjectInventory(part.UUID, remoteClient.AgentId)) | ||
1086 | return; | ||
1087 | } | ||
1088 | else | ||
1089 | { | ||
1090 | // If the item is copiable, then we just need to have perms | ||
1091 | // on it. The delete check is a pure rights check | ||
1092 | if (!Permissions.CanDeleteObject(part.UUID, remoteClient.AgentId)) | ||
1093 | return; | ||
1094 | } | ||
1080 | 1095 | ||
1081 | MoveTaskInventoryItem(remoteClient, folderId, part, itemId); | 1096 | MoveTaskInventoryItem(remoteClient, folderId, part, itemId); |
1082 | } | 1097 | } |
@@ -1359,16 +1374,45 @@ namespace OpenSim.Region.Framework.Scenes | |||
1359 | { | 1374 | { |
1360 | agentTransactions.HandleTaskItemUpdateFromTransaction( | 1375 | agentTransactions.HandleTaskItemUpdateFromTransaction( |
1361 | remoteClient, part, transactionID, currentItem); | 1376 | remoteClient, part, transactionID, currentItem); |
1362 | } | 1377 | |
1363 | if (part.Inventory.UpdateInventoryItem(itemInfo)) | ||
1364 | { | ||
1365 | if ((InventoryType)itemInfo.InvType == InventoryType.Notecard) | 1378 | if ((InventoryType)itemInfo.InvType == InventoryType.Notecard) |
1366 | remoteClient.SendAgentAlertMessage("Notecard saved", false); | 1379 | remoteClient.SendAgentAlertMessage("Notecard saved", false); |
1367 | else if ((InventoryType)itemInfo.InvType == InventoryType.LSL) | 1380 | else if ((InventoryType)itemInfo.InvType == InventoryType.LSL) |
1368 | remoteClient.SendAgentAlertMessage("Script saved", false); | 1381 | remoteClient.SendAgentAlertMessage("Script saved", false); |
1369 | else | 1382 | else |
1370 | remoteClient.SendAgentAlertMessage("Item saved", false); | 1383 | remoteClient.SendAgentAlertMessage("Item saved", false); |
1384 | } | ||
1385 | |||
1386 | // Check if we're allowed to mess with permissions | ||
1387 | if (!Permissions.IsGod(remoteClient.AgentId)) // Not a god | ||
1388 | { | ||
1389 | if (remoteClient.AgentId != part.OwnerID) // Not owner | ||
1390 | { | ||
1391 | // Friends and group members can't change any perms | ||
1392 | itemInfo.BasePermissions = currentItem.BasePermissions; | ||
1393 | itemInfo.EveryonePermissions = currentItem.EveryonePermissions; | ||
1394 | itemInfo.GroupPermissions = currentItem.GroupPermissions; | ||
1395 | itemInfo.NextPermissions = currentItem.NextPermissions; | ||
1396 | itemInfo.CurrentPermissions = currentItem.CurrentPermissions; | ||
1397 | } | ||
1398 | else | ||
1399 | { | ||
1400 | // Owner can't change base, and can change other | ||
1401 | // only up to base | ||
1402 | // Base ALWAYS has move | ||
1403 | currentItem.BasePermissions |= (uint)PermissionMask.Move; | ||
1404 | itemInfo.BasePermissions = currentItem.BasePermissions; | ||
1405 | itemInfo.EveryonePermissions &= currentItem.BasePermissions; | ||
1406 | itemInfo.GroupPermissions &= currentItem.BasePermissions; | ||
1407 | itemInfo.CurrentPermissions &= currentItem.BasePermissions; | ||
1408 | itemInfo.NextPermissions &= currentItem.BasePermissions; | ||
1409 | // Next ALWAYS has move | ||
1410 | itemInfo.NextPermissions |= (uint)PermissionMask.Move; | ||
1411 | } | ||
1371 | 1412 | ||
1413 | } | ||
1414 | if (part.Inventory.UpdateInventoryItem(itemInfo)) | ||
1415 | { | ||
1372 | part.GetProperties(remoteClient); | 1416 | part.GetProperties(remoteClient); |
1373 | } | 1417 | } |
1374 | } | 1418 | } |