diff options
author | Melanie Thielker | 2008-10-08 02:45:23 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-10-08 02:45:23 +0000 |
commit | c4d741180f0c69db90c8ccb2a06857656e7b1082 (patch) | |
tree | 6be3f8ebc4881178f2f4f8adb1c47884e3ac236e /OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | |
parent | Mantis#2352. Thank you kindly, Jonc for a patch that: (diff) | |
download | opensim-SC_OLD-c4d741180f0c69db90c8ccb2a06857656e7b1082.zip opensim-SC_OLD-c4d741180f0c69db90c8ccb2a06857656e7b1082.tar.gz opensim-SC_OLD-c4d741180f0c69db90c8ccb2a06857656e7b1082.tar.bz2 opensim-SC_OLD-c4d741180f0c69db90c8ccb2a06857656e7b1082.tar.xz |
Add some permissions checks and fixes
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.Inventory.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index 204ba39..eb21221 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | |||
@@ -928,6 +928,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
928 | return null; | 928 | return null; |
929 | } | 929 | } |
930 | 930 | ||
931 | if ((destAgent != taskItem.OwnerID) && ((taskItem.CurrentPermissions & (uint)PermissionMask.Transfer) == 0)) | ||
932 | { | ||
933 | return null; | ||
934 | } | ||
935 | |||
931 | InventoryItemBase agentItem = new InventoryItemBase(); | 936 | InventoryItemBase agentItem = new InventoryItemBase(); |
932 | 937 | ||
933 | agentItem.ID = UUID.Random(); | 938 | agentItem.ID = UUID.Random(); |
@@ -943,7 +948,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
943 | if ((destAgent != taskItem.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions()) | 948 | if ((destAgent != taskItem.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions()) |
944 | { | 949 | { |
945 | agentItem.BasePermissions = taskItem.NextPermissions; | 950 | agentItem.BasePermissions = taskItem.NextPermissions; |
946 | agentItem.CurrentPermissions = taskItem.NextPermissions; | 951 | agentItem.CurrentPermissions = taskItem.NextPermissions | 8; |
947 | agentItem.NextPermissions = taskItem.NextPermissions; | 952 | agentItem.NextPermissions = taskItem.NextPermissions; |
948 | agentItem.EveryOnePermissions = taskItem.EveryonePermissions & taskItem.NextPermissions; | 953 | agentItem.EveryOnePermissions = taskItem.EveryonePermissions & taskItem.NextPermissions; |
949 | } | 954 | } |
@@ -976,6 +981,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
976 | 981 | ||
977 | InventoryItemBase agentItem = CreateAgentInventoryItemFromTask(remoteClient.AgentId, part, itemId); | 982 | InventoryItemBase agentItem = CreateAgentInventoryItemFromTask(remoteClient.AgentId, part, itemId); |
978 | 983 | ||
984 | if (agentItem == null) | ||
985 | return; | ||
986 | |||
979 | agentItem.Folder = folderId; | 987 | agentItem.Folder = folderId; |
980 | AddInventoryItem(remoteClient, agentItem); | 988 | AddInventoryItem(remoteClient, agentItem); |
981 | } | 989 | } |
@@ -1045,6 +1053,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
1045 | avatarId); | 1053 | avatarId); |
1046 | } | 1054 | } |
1047 | InventoryItemBase agentItem = CreateAgentInventoryItemFromTask(avatarId, part, itemId); | 1055 | InventoryItemBase agentItem = CreateAgentInventoryItemFromTask(avatarId, part, itemId); |
1056 | |||
1057 | if (agentItem == null) | ||
1058 | return; | ||
1059 | |||
1048 | agentItem.Folder = folderId; | 1060 | agentItem.Folder = folderId; |
1049 | 1061 | ||
1050 | AddInventoryItem(avatarId, agentItem); | 1062 | AddInventoryItem(avatarId, agentItem); |
@@ -1082,6 +1094,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
1082 | return; | 1094 | return; |
1083 | } | 1095 | } |
1084 | 1096 | ||
1097 | // Can't transfer this | ||
1098 | // | ||
1099 | if ((part.OwnerID != destPart.OwnerID) && ((srcTaskItem.CurrentPermissions & (uint)PermissionMask.Transfer) == 0)) | ||
1100 | return; | ||
1101 | |||
1085 | if (part.OwnerID != destPart.OwnerID && (part.GetEffectiveObjectFlags() & (uint)PrimFlags.AllowInventoryDrop) == 0) | 1102 | if (part.OwnerID != destPart.OwnerID && (part.GetEffectiveObjectFlags() & (uint)PrimFlags.AllowInventoryDrop) == 0) |
1086 | { | 1103 | { |
1087 | // object cannot copy items to an object owned by a different owner | 1104 | // object cannot copy items to an object owned by a different owner |
@@ -1166,9 +1183,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
1166 | foreach (UUID itemID in items) | 1183 | foreach (UUID itemID in items) |
1167 | { | 1184 | { |
1168 | InventoryItemBase agentItem = CreateAgentInventoryItemFromTask(destID, host, itemID); | 1185 | InventoryItemBase agentItem = CreateAgentInventoryItemFromTask(destID, host, itemID); |
1169 | agentItem.Folder = newFolderID; | ||
1170 | 1186 | ||
1171 | AddInventoryItem(destID, agentItem); | 1187 | if (agentItem != null) |
1188 | { | ||
1189 | agentItem.Folder = newFolderID; | ||
1190 | |||
1191 | AddInventoryItem(destID, agentItem); | ||
1192 | } | ||
1172 | } | 1193 | } |
1173 | 1194 | ||
1174 | ScenePresence avatar; | 1195 | ScenePresence avatar; |