aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs64
1 files changed, 42 insertions, 22 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 5e1798b..b859042 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -73,7 +73,7 @@ namespace OpenSim.Region.Framework.Scenes
73 IMoneyModule money=RequestModuleInterface<IMoneyModule>(); 73 IMoneyModule money=RequestModuleInterface<IMoneyModule>();
74 if (money != null) 74 if (money != null)
75 { 75 {
76 money.ApplyUploadCharge(agentID); 76 money.ApplyUploadCharge(agentID, money.UploadCharge, "Asset upload");
77 } 77 }
78 78
79 AddInventoryItem(agentID, item); 79 AddInventoryItem(agentID, item);
@@ -400,9 +400,9 @@ namespace OpenSim.Region.Framework.Scenes
400 if (Permissions.PropagatePermissions() && recipient != senderId) 400 if (Permissions.PropagatePermissions() && recipient != senderId)
401 { 401 {
402 // First, make sore base is limited to the next perms 402 // First, make sore base is limited to the next perms
403 itemCopy.BasePermissions = item.BasePermissions & item.NextPermissions; 403 itemCopy.BasePermissions = item.BasePermissions & (item.NextPermissions | (uint)PermissionMask.Move);
404 // By default, current equals base 404 // By default, current equals base
405 itemCopy.CurrentPermissions = itemCopy.BasePermissions; 405 itemCopy.CurrentPermissions = itemCopy.BasePermissions & item.CurrentPermissions;
406 406
407 // If this is an object, replace current perms 407 // If this is an object, replace current perms
408 // with folded perms 408 // with folded perms
@@ -413,7 +413,7 @@ namespace OpenSim.Region.Framework.Scenes
413 } 413 }
414 414
415 // Ensure there is no escalation 415 // Ensure there is no escalation
416 itemCopy.CurrentPermissions &= item.NextPermissions; 416 itemCopy.CurrentPermissions &= (item.NextPermissions | (uint)PermissionMask.Move);
417 417
418 // Need slam bit on xfer 418 // Need slam bit on xfer
419 itemCopy.CurrentPermissions |= 8; 419 itemCopy.CurrentPermissions |= 8;
@@ -916,14 +916,15 @@ namespace OpenSim.Region.Framework.Scenes
916 916
917 if ((part.OwnerID != destAgent) && Permissions.PropagatePermissions()) 917 if ((part.OwnerID != destAgent) && Permissions.PropagatePermissions())
918 { 918 {
919 agentItem.BasePermissions = taskItem.BasePermissions & taskItem.NextPermissions; 919 agentItem.BasePermissions = taskItem.BasePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move);
920 if (taskItem.InvType == (int)InventoryType.Object) 920 if (taskItem.InvType == (int)InventoryType.Object)
921 agentItem.CurrentPermissions = agentItem.BasePermissions & ((taskItem.CurrentPermissions & 7) << 13); 921 agentItem.CurrentPermissions = agentItem.BasePermissions & (((taskItem.CurrentPermissions & 7) << 13) | (taskItem.CurrentPermissions & (uint)PermissionMask.Move));
922 agentItem.CurrentPermissions = agentItem.BasePermissions ; 922 else
923 agentItem.CurrentPermissions = agentItem.BasePermissions & taskItem.CurrentPermissions;
923 924
924 agentItem.CurrentPermissions |= 8; 925 agentItem.CurrentPermissions |= 8;
925 agentItem.NextPermissions = taskItem.NextPermissions; 926 agentItem.NextPermissions = taskItem.NextPermissions;
926 agentItem.EveryOnePermissions = taskItem.EveryonePermissions & taskItem.NextPermissions; 927 agentItem.EveryOnePermissions = taskItem.EveryonePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move);
927 agentItem.GroupPermissions = taskItem.GroupPermissions & taskItem.NextPermissions; 928 agentItem.GroupPermissions = taskItem.GroupPermissions & taskItem.NextPermissions;
928 } 929 }
929 else 930 else
@@ -1105,13 +1106,13 @@ namespace OpenSim.Region.Framework.Scenes
1105 if (Permissions.PropagatePermissions()) 1106 if (Permissions.PropagatePermissions())
1106 { 1107 {
1107 destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions & 1108 destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions &
1108 srcTaskItem.NextPermissions; 1109 (srcTaskItem.NextPermissions | (uint)PermissionMask.Move);
1109 destTaskItem.GroupPermissions = srcTaskItem.GroupPermissions & 1110 destTaskItem.GroupPermissions = srcTaskItem.GroupPermissions &
1110 srcTaskItem.NextPermissions; 1111 (srcTaskItem.NextPermissions | (uint)PermissionMask.Move);
1111 destTaskItem.EveryonePermissions = srcTaskItem.EveryonePermissions & 1112 destTaskItem.EveryonePermissions = srcTaskItem.EveryonePermissions &
1112 srcTaskItem.NextPermissions; 1113 (srcTaskItem.NextPermissions | (uint)PermissionMask.Move);
1113 destTaskItem.BasePermissions = srcTaskItem.BasePermissions & 1114 destTaskItem.BasePermissions = srcTaskItem.BasePermissions &
1114 srcTaskItem.NextPermissions; 1115 (srcTaskItem.NextPermissions | (uint)PermissionMask.Move);
1115 destTaskItem.CurrentPermissions |= 8; // Slam! 1116 destTaskItem.CurrentPermissions |= 8; // Slam!
1116 } 1117 }
1117 } 1118 }
@@ -1284,7 +1285,7 @@ namespace OpenSim.Region.Framework.Scenes
1284 } 1285 }
1285 if (part.Inventory.UpdateInventoryItem(itemInfo)) 1286 if (part.Inventory.UpdateInventoryItem(itemInfo))
1286 { 1287 {
1287 remoteClient.SendAgentAlertMessage("Notecard saved", false); 1288 // remoteClient.SendAgentAlertMessage("Notecard saved", false);
1288 part.GetProperties(remoteClient); 1289 part.GetProperties(remoteClient);
1289 } 1290 }
1290 } 1291 }
@@ -1377,7 +1378,7 @@ namespace OpenSim.Region.Framework.Scenes
1377 return; 1378 return;
1378 1379
1379 AssetBase asset = CreateAsset(itemBase.Name, itemBase.Description, (sbyte)itemBase.AssetType, 1380 AssetBase asset = CreateAsset(itemBase.Name, itemBase.Description, (sbyte)itemBase.AssetType,
1380 Encoding.ASCII.GetBytes("default\n{\n state_entry()\n {\n llSay(0, \"Script running\");\n }\n}"), 1381 Encoding.ASCII.GetBytes("default\n{\n state_entry()\n {\n llSay(0, \"Script running\");\n }\n\n touch_start(integer num)\n {\n }\n}"),
1381 remoteClient.AgentId); 1382 remoteClient.AgentId);
1382 AssetService.Store(asset); 1383 AssetService.Store(asset);
1383 1384
@@ -1592,18 +1593,36 @@ namespace OpenSim.Region.Framework.Scenes
1592 // for when deleting the object from it 1593 // for when deleting the object from it
1593 ForceSceneObjectBackup(grp); 1594 ForceSceneObjectBackup(grp);
1594 1595
1595 if (!Permissions.CanTakeCopyObject(grp.UUID, remoteClient.AgentId)) 1596 if (remoteClient == null)
1596 permissionToTakeCopy = false; 1597 {
1597 if (!Permissions.CanTakeObject(grp.UUID, remoteClient.AgentId)) 1598 // Autoreturn has a null client. Nothing else does. So
1598 permissionToTake = false; 1599 // allow only returns
1600 if (action != DeRezAction.Return)
1601 return;
1599 1602
1600 if (!Permissions.CanDeleteObject(grp.UUID, remoteClient.AgentId)) 1603 permissionToTakeCopy = false;
1601 permissionToDelete = false; 1604 }
1605 else
1606 {
1607 if (action == DeRezAction.TakeCopy)
1608 {
1609 if (!Permissions.CanTakeCopyObject(grp.UUID, remoteClient.AgentId))
1610 permissionToTakeCopy = false;
1611 }
1612 else
1613 {
1614 permissionToTakeCopy = false;
1615 }
1616 if (!Permissions.CanTakeObject(grp.UUID, remoteClient.AgentId))
1617 permissionToTake = false;
1602 1618
1619 if (!Permissions.CanDeleteObject(grp.UUID, remoteClient.AgentId))
1620 permissionToDelete = false;
1621 }
1603 } 1622 }
1604 1623
1605 // Handle god perms 1624 // Handle god perms
1606 if (Permissions.IsGod(remoteClient.AgentId)) 1625 if (remoteClient != null && Permissions.IsGod(remoteClient.AgentId))
1607 { 1626 {
1608 permissionToTake = true; 1627 permissionToTake = true;
1609 permissionToTakeCopy = true; 1628 permissionToTakeCopy = true;
@@ -1614,7 +1633,7 @@ namespace OpenSim.Region.Framework.Scenes
1614 if (action == DeRezAction.SaveToExistingUserInventoryItem) 1633 if (action == DeRezAction.SaveToExistingUserInventoryItem)
1615 permissionToDelete = false; 1634 permissionToDelete = false;
1616 1635
1617 // if we want to take a copy,, we also don't want to delete 1636 // if we want to take a copy, we also don't want to delete
1618 // Note: after this point, the permissionToTakeCopy flag 1637 // Note: after this point, the permissionToTakeCopy flag
1619 // becomes irrelevant. It already includes the permissionToTake 1638 // becomes irrelevant. It already includes the permissionToTake
1620 // permission and after excluding no copy items here, we can 1639 // permission and after excluding no copy items here, we can
@@ -1625,6 +1644,7 @@ namespace OpenSim.Region.Framework.Scenes
1625 if (!permissionToTakeCopy) 1644 if (!permissionToTakeCopy)
1626 return; 1645 return;
1627 1646
1647 permissionToTake = true;
1628 // Don't delete 1648 // Don't delete
1629 permissionToDelete = false; 1649 permissionToDelete = false;
1630 } 1650 }