diff options
Diffstat (limited to 'OpenSim/Tests/Permissions/Common.cs')
-rw-r--r-- | OpenSim/Tests/Permissions/Common.cs | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/OpenSim/Tests/Permissions/Common.cs b/OpenSim/Tests/Permissions/Common.cs index 84dadf2..e62991b 100644 --- a/OpenSim/Tests/Permissions/Common.cs +++ b/OpenSim/Tests/Permissions/Common.cs | |||
@@ -1,6 +1,31 @@ | |||
1 | using System; | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | using System; | ||
2 | using System.Collections.Generic; | 28 | using System.Collections.Generic; |
3 | using System.Reflection; | ||
4 | using System.Threading; | 29 | using System.Threading; |
5 | using Nini.Config; | 30 | using Nini.Config; |
6 | using NUnit.Framework; | 31 | using NUnit.Framework; |
@@ -10,7 +35,6 @@ using OpenSim.Region.Framework.Scenes; | |||
10 | using OpenSim.Region.CoreModules.World.Permissions; | 35 | using OpenSim.Region.CoreModules.World.Permissions; |
11 | using OpenSim.Region.CoreModules.Avatar.Inventory.Transfer; | 36 | using OpenSim.Region.CoreModules.Avatar.Inventory.Transfer; |
12 | using OpenSim.Region.CoreModules.Framework.InventoryAccess; | 37 | using OpenSim.Region.CoreModules.Framework.InventoryAccess; |
13 | using OpenSim.Region.Framework.Scenes.Serialization; | ||
14 | using OpenSim.Services.Interfaces; | 38 | using OpenSim.Services.Interfaces; |
15 | using OpenSim.Tests.Common; | 39 | using OpenSim.Tests.Common; |
16 | using PermissionMask = OpenSim.Framework.PermissionMask; | 40 | using PermissionMask = OpenSim.Framework.PermissionMask; |
@@ -67,7 +91,7 @@ namespace OpenSim.Tests.Permissions | |||
67 | /// - 6 simple boxes inworld belonging to A0 and with Next Owner perms: | 91 | /// - 6 simple boxes inworld belonging to A0 and with Next Owner perms: |
68 | /// C, CT, MC, MCT, MT, T | 92 | /// C, CT, MC, MCT, MT, T |
69 | /// - Copies of all of these boxes in A0's inventory in the Objects folder | 93 | /// - Copies of all of these boxes in A0's inventory in the Objects folder |
70 | /// - One additional box in A0's inventory which is a copy of MCT, but | 94 | /// - One additional box inworld and in A0's inventory which is a copy of MCT, but |
71 | /// with C removed in inventory. This one is called MCT-C | 95 | /// with C removed in inventory. This one is called MCT-C |
72 | /// </summary> | 96 | /// </summary> |
73 | private void SetUpBasicEnvironment() | 97 | private void SetUpBasicEnvironment() |
@@ -140,7 +164,7 @@ namespace OpenSim.Tests.Permissions | |||
140 | PrintPerms(box); | 164 | PrintPerms(box); |
141 | AssertPermissions(nextOwnerPerms, (PermissionMask)box.RootPart.NextOwnerMask, box.OwnerID.ToString().Substring(34) + " : " + box.Name); | 165 | AssertPermissions(nextOwnerPerms, (PermissionMask)box.RootPart.NextOwnerMask, box.OwnerID.ToString().Substring(34) + " : " + box.Name); |
142 | 166 | ||
143 | TakeCopyToInventory(box); | 167 | TakeCopyToInventory(0, box); |
144 | 168 | ||
145 | } | 169 | } |
146 | 170 | ||
@@ -218,14 +242,14 @@ namespace OpenSim.Tests.Permissions | |||
218 | return so; | 242 | return so; |
219 | } | 243 | } |
220 | 244 | ||
221 | public void TakeCopyToInventory(SceneObjectGroup sog) | 245 | public void TakeCopyToInventory(int userIndex, SceneObjectGroup sog) |
222 | { | 246 | { |
223 | InventoryFolderBase objsFolder = UserInventoryHelpers.GetInventoryFolder(m_Scene.InventoryService, sog.OwnerID, "Objects"); | 247 | InventoryFolderBase objsFolder = UserInventoryHelpers.GetInventoryFolder(m_Scene.InventoryService, m_Avatars[userIndex].UUID, "Objects"); |
224 | Assert.That(objsFolder, Is.Not.Null); | 248 | Assert.That(objsFolder, Is.Not.Null); |
225 | 249 | ||
226 | List<uint> localIds = new List<uint>(); localIds.Add(sog.LocalId); | 250 | List<uint> localIds = new List<uint>(); localIds.Add(sog.LocalId); |
227 | // This is an async operation | 251 | // This is an async operation |
228 | m_Scene.DeRezObjects((IClientAPI)m_Avatars[0].ClientView, localIds, sog.UUID, DeRezAction.TakeCopy, objsFolder.ID); | 252 | m_Scene.DeRezObjects((IClientAPI)m_Avatars[userIndex].ClientView, localIds, m_Avatars[userIndex].UUID, DeRezAction.TakeCopy, objsFolder.ID); |
229 | } | 253 | } |
230 | 254 | ||
231 | public InventoryItemBase GetItemFromInventory(UUID userID, string folderName, string itemName) | 255 | public InventoryItemBase GetItemFromInventory(UUID userID, string folderName, string itemName) |