aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tests/Permissions/Common.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Tests/Permissions/Common.cs')
-rw-r--r--OpenSim/Tests/Permissions/Common.cs40
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 @@
1using 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 */
27using System;
2using System.Collections.Generic; 28using System.Collections.Generic;
3using System.Reflection;
4using System.Threading; 29using System.Threading;
5using Nini.Config; 30using Nini.Config;
6using NUnit.Framework; 31using NUnit.Framework;
@@ -10,7 +35,6 @@ using OpenSim.Region.Framework.Scenes;
10using OpenSim.Region.CoreModules.World.Permissions; 35using OpenSim.Region.CoreModules.World.Permissions;
11using OpenSim.Region.CoreModules.Avatar.Inventory.Transfer; 36using OpenSim.Region.CoreModules.Avatar.Inventory.Transfer;
12using OpenSim.Region.CoreModules.Framework.InventoryAccess; 37using OpenSim.Region.CoreModules.Framework.InventoryAccess;
13using OpenSim.Region.Framework.Scenes.Serialization;
14using OpenSim.Services.Interfaces; 38using OpenSim.Services.Interfaces;
15using OpenSim.Tests.Common; 39using OpenSim.Tests.Common;
16using PermissionMask = OpenSim.Framework.PermissionMask; 40using 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)