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 | |
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 '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 56 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 3 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 6 |
3 files changed, 53 insertions, 12 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 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 87b2d74..b19c443 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -4156,6 +4156,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
4156 | // objects | 4156 | // objects |
4157 | if ((_nextOwnerMask & (uint)PermissionMask.Copy) == 0) | 4157 | if ((_nextOwnerMask & (uint)PermissionMask.Copy) == 0) |
4158 | _nextOwnerMask |= (uint)PermissionMask.Transfer; | 4158 | _nextOwnerMask |= (uint)PermissionMask.Transfer; |
4159 | |||
4160 | _nextOwnerMask |= (uint)PermissionMask.Move; | ||
4161 | |||
4159 | break; | 4162 | break; |
4160 | } | 4163 | } |
4161 | SendFullUpdateToAllClients(); | 4164 | SendFullUpdateToAllClients(); |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 0066158..2a3727a 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -762,12 +762,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
762 | else if ((InventoryType)item.Type == InventoryType.Notecard) | 762 | else if ((InventoryType)item.Type == InventoryType.Notecard) |
763 | { | 763 | { |
764 | ScenePresence presence = m_part.ParentGroup.Scene.GetScenePresence(item.OwnerID); | 764 | ScenePresence presence = m_part.ParentGroup.Scene.GetScenePresence(item.OwnerID); |
765 | |||
766 | if (presence != null) | ||
767 | { | ||
768 | presence.ControllingClient.SendAgentAlertMessage( | ||
769 | "Notecard saved", false); | ||
770 | } | ||
771 | } | 765 | } |
772 | 766 | ||
773 | m_items[item.ItemID] = item; | 767 | m_items[item.ItemID] = item; |