diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 59 |
1 files changed, 53 insertions, 6 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 96a9d97..d79a7f1 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -915,6 +915,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
915 | SceneObjectGroup group = part.ParentGroup; | 915 | SceneObjectGroup group = part.ParentGroup; |
916 | if (group != null) | 916 | if (group != null) |
917 | { | 917 | { |
918 | if (!Permissions.CanEditObjectInventory(part.UUID, remoteClient.AgentId)) | ||
919 | return; | ||
920 | |||
918 | TaskInventoryItem item = group.GetInventoryItem(localID, itemID); | 921 | TaskInventoryItem item = group.GetInventoryItem(localID, itemID); |
919 | if (item == null) | 922 | if (item == null) |
920 | return; | 923 | return; |
@@ -1054,9 +1057,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
1054 | return; | 1057 | return; |
1055 | } | 1058 | } |
1056 | 1059 | ||
1057 | // Only owner can copy | 1060 | TaskInventoryItem item = part.Inventory.GetInventoryItem(itemId); |
1058 | if (remoteClient.AgentId != taskItem.OwnerID) | 1061 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) |
1059 | return; | 1062 | { |
1063 | // If the item to be moved is no copy, we need to be able to | ||
1064 | // edit the prim. | ||
1065 | if (!Permissions.CanEditObjectInventory(part.UUID, remoteClient.AgentId)) | ||
1066 | return; | ||
1067 | } | ||
1068 | else | ||
1069 | { | ||
1070 | // If the item is copiable, then we just need to have perms | ||
1071 | // on it. The delete check is a pure rights check | ||
1072 | if (!Permissions.CanDeleteObject(part.UUID, remoteClient.AgentId)) | ||
1073 | return; | ||
1074 | } | ||
1060 | 1075 | ||
1061 | MoveTaskInventoryItem(remoteClient, folderId, part, itemId); | 1076 | MoveTaskInventoryItem(remoteClient, folderId, part, itemId); |
1062 | } | 1077 | } |
@@ -1339,16 +1354,48 @@ namespace OpenSim.Region.Framework.Scenes | |||
1339 | { | 1354 | { |
1340 | agentTransactions.HandleTaskItemUpdateFromTransaction( | 1355 | agentTransactions.HandleTaskItemUpdateFromTransaction( |
1341 | remoteClient, part, transactionID, currentItem); | 1356 | remoteClient, part, transactionID, currentItem); |
1342 | } | 1357 | |
1343 | if (part.Inventory.UpdateInventoryItem(itemInfo)) | ||
1344 | { | ||
1345 | if ((InventoryType)itemInfo.InvType == InventoryType.Notecard) | 1358 | if ((InventoryType)itemInfo.InvType == InventoryType.Notecard) |
1346 | remoteClient.SendAgentAlertMessage("Notecard saved", false); | 1359 | remoteClient.SendAgentAlertMessage("Notecard saved", false); |
1347 | else if ((InventoryType)itemInfo.InvType == InventoryType.LSL) | 1360 | else if ((InventoryType)itemInfo.InvType == InventoryType.LSL) |
1348 | remoteClient.SendAgentAlertMessage("Script saved", false); | 1361 | remoteClient.SendAgentAlertMessage("Script saved", false); |
1349 | else | 1362 | else |
1350 | remoteClient.SendAgentAlertMessage("Item saved", false); | 1363 | remoteClient.SendAgentAlertMessage("Item saved", false); |
1364 | } | ||
1365 | |||
1366 | // Base ALWAYS has move | ||
1367 | currentItem.BasePermissions |= (uint)PermissionMask.Move; | ||
1368 | |||
1369 | // Check if we're allowed to mess with permissions | ||
1370 | if (!Permissions.IsGod(remoteClient.AgentId)) // Not a god | ||
1371 | { | ||
1372 | if (remoteClient.AgentId != part.OwnerID) // Not owner | ||
1373 | { | ||
1374 | // Friends and group members can't change any perms | ||
1375 | itemInfo.BasePermissions = currentItem.BasePermissions; | ||
1376 | itemInfo.EveryonePermissions = currentItem.EveryonePermissions; | ||
1377 | itemInfo.GroupPermissions = currentItem.GroupPermissions; | ||
1378 | itemInfo.NextPermissions = currentItem.NextPermissions; | ||
1379 | itemInfo.CurrentPermissions = currentItem.CurrentPermissions; | ||
1380 | } | ||
1381 | else | ||
1382 | { | ||
1383 | // Owner can't change base, and can change other | ||
1384 | // only up to base | ||
1385 | itemInfo.BasePermissions = currentItem.BasePermissions; | ||
1386 | itemInfo.EveryonePermissions &= currentItem.BasePermissions; | ||
1387 | itemInfo.GroupPermissions &= currentItem.BasePermissions; | ||
1388 | itemInfo.CurrentPermissions &= currentItem.BasePermissions; | ||
1389 | itemInfo.NextPermissions &= currentItem.BasePermissions; | ||
1390 | } | ||
1391 | |||
1392 | } | ||
1351 | 1393 | ||
1394 | // Next ALWAYS has move | ||
1395 | itemInfo.NextPermissions |= (uint)PermissionMask.Move; | ||
1396 | |||
1397 | if (part.Inventory.UpdateInventoryItem(itemInfo)) | ||
1398 | { | ||
1352 | part.GetProperties(remoteClient); | 1399 | part.GetProperties(remoteClient); |
1353 | } | 1400 | } |
1354 | } | 1401 | } |