aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorDiva Canto2017-05-04 18:20:48 -0700
committerDiva Canto2017-05-04 18:20:48 -0700
commit424a7a274b66bb06c9a3711ee9de267231b89b71 (patch)
tree02c1054d7457cd45cd3d62d677affe8f5f209998 /OpenSim
parentAdd a groups module to the perms test suite (diff)
parentfix bad move on xmlgroups (diff)
downloadopensim-SC-424a7a274b66bb06c9a3711ee9de267231b89b71.zip
opensim-SC-424a7a274b66bb06c9a3711ee9de267231b89b71.tar.gz
opensim-SC-424a7a274b66bb06c9a3711ee9de267231b89b71.tar.bz2
opensim-SC-424a7a274b66bb06c9a3711ee9de267231b89b71.tar.xz
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Addons/Groups/GroupsModule.cs2
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs2
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/ObjectAdd.cs2
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs69
-rw-r--r--OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs22
-rw-r--r--OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs60
-rw-r--r--OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs34
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Permissions.cs20
-rwxr-xr-xOpenSim/Region/Framework/Scenes/Scene.cs6
-rwxr-xr-xOpenSim/Region/Framework/Scenes/SceneGraph.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs99
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs12
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs7
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs59
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs2
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs2
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs3
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs2
-rw-r--r--OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs14
-rw-r--r--OpenSim/Tests/Common/Helpers/SceneHelpers.cs2
26 files changed, 273 insertions, 164 deletions
diff --git a/OpenSim/Addons/Groups/GroupsModule.cs b/OpenSim/Addons/Groups/GroupsModule.cs
index 0e3a172..5b76e0a 100644
--- a/OpenSim/Addons/Groups/GroupsModule.cs
+++ b/OpenSim/Addons/Groups/GroupsModule.cs
@@ -787,7 +787,7 @@ namespace OpenSim.Groups
787 remoteClient.SendCreateGroupReply(groupID, true, "Group created successfully"); 787 remoteClient.SendCreateGroupReply(groupID, true, "Group created successfully");
788 788
789 // Update the founder with new group information. 789 // Update the founder with new group information.
790 SendAgentGroupDataUpdate(remoteClient, false); 790 SendAgentGroupDataUpdate(remoteClient, true);
791 } 791 }
792 else 792 else
793 remoteClient.SendCreateGroupReply(groupID, false, reason); 793 remoteClient.SendCreateGroupReply(groupID, false, reason);
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 168836c..0862fcf 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -237,7 +237,7 @@ namespace OpenSim
237 string permissionModules = Util.GetConfigVarFromSections<string>(Config, "permissionmodules", 237 string permissionModules = Util.GetConfigVarFromSections<string>(Config, "permissionmodules",
238 new string[] { "Startup", "Permissions" }, "DefaultPermissionsModule"); 238 new string[] { "Startup", "Permissions" }, "DefaultPermissionsModule");
239 239
240 m_permsModules = new List<string>(permissionModules.Split(',')); 240 m_permsModules = new List<string>(permissionModules.Split(',').Select(m => m.Trim()));
241 241
242 managedStatsURI = startupConfig.GetString("ManagedStatsRemoteFetchURI", String.Empty); 242 managedStatsURI = startupConfig.GetString("ManagedStatsRemoteFetchURI", String.Empty);
243 managedStatsPassword = startupConfig.GetString("ManagedStatsRemoteFetchPassword", String.Empty); 243 managedStatsPassword = startupConfig.GetString("ManagedStatsRemoteFetchPassword", String.Empty);
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/ObjectAdd.cs b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/ObjectAdd.cs
index 69fcb7d..b044e56 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/ObjectAdd.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/ObjectAdd.cs
@@ -357,7 +357,7 @@ namespace OpenSim.Region.ClientStack.Linden
357 rootpart.NextOwnerMask = next_owner_mask; 357 rootpart.NextOwnerMask = next_owner_mask;
358 rootpart.Material = (byte)material; 358 rootpart.Material = (byte)material;
359 359
360 obj.AggregatePerms(); 360 obj.InvalidateDeepEffectivePerms();
361 361
362 m_scene.PhysicsScene.AddPhysicsActorTaint(rootpart.PhysActor); 362 m_scene.PhysicsScene.AddPhysicsActorTaint(rootpart.PhysActor);
363 363
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index f1885da..3f3245c 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -1182,7 +1182,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
1182 } 1182 }
1183 1183
1184 rootPart.TrimPermissions(); 1184 rootPart.TrimPermissions();
1185 so.AggregateDeepPerms(); 1185 so.InvalidateDeepEffectivePerms();
1186 1186
1187 if (isAttachment) 1187 if (isAttachment)
1188 so.FromItemID = item.ID; 1188 so.FromItemID = item.ID;
diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
index 311deab..895020c 100644
--- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
+++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
@@ -26,15 +26,15 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Threading;
30using System.Collections.Generic; 29using System.Collections.Generic;
31using System.Collections; 30using System.Collections;
32using System.Reflection; 31using System.Reflection;
32using System.Net;
33using System.Net.Sockets;
33using log4net; 34using log4net;
34using Mono.Addins; 35using Mono.Addins;
35using Nini.Config; 36using Nini.Config;
36using OpenMetaverse; 37using OpenMetaverse;
37using OpenSim.Framework;
38using OpenSim.Framework.Servers; 38using OpenSim.Framework.Servers;
39using OpenSim.Framework.Servers.HttpServer; 39using OpenSim.Framework.Servers.HttpServer;
40using OpenSim.Region.Framework.Interfaces; 40using OpenSim.Region.Framework.Interfaces;
@@ -89,6 +89,8 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
89 protected Dictionary<string, UrlData> m_UrlMap = 89 protected Dictionary<string, UrlData> m_UrlMap =
90 new Dictionary<string, UrlData>(); 90 new Dictionary<string, UrlData>();
91 91
92 protected bool m_enabled = false;
93 protected string m_ErrorStr;
92 protected uint m_HttpsPort = 0; 94 protected uint m_HttpsPort = 0;
93 protected IHttpServer m_HttpServer = null; 95 protected IHttpServer m_HttpServer = null;
94 protected IHttpServer m_HttpsServer = null; 96 protected IHttpServer m_HttpsServer = null;
@@ -118,6 +120,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
118 public void Initialise(IConfigSource config) 120 public void Initialise(IConfigSource config)
119 { 121 {
120 IConfig networkConfig = config.Configs["Network"]; 122 IConfig networkConfig = config.Configs["Network"];
123 m_enabled = false;
121 124
122 if (networkConfig != null) 125 if (networkConfig != null)
123 { 126 {
@@ -128,9 +131,47 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
128 if (ssl_enabled) 131 if (ssl_enabled)
129 m_HttpsPort = (uint)config.Configs["Network"].GetInt("https_port", (int)m_HttpsPort); 132 m_HttpsPort = (uint)config.Configs["Network"].GetInt("https_port", (int)m_HttpsPort);
130 } 133 }
134 else
135 {
136 m_ErrorStr = "[Network] configuration missing, HTTP listener for LSL disabled";
137 m_log.Warn("[URL MODULE]: " + m_ErrorStr);
138 return;
139 }
140
141 if (String.IsNullOrWhiteSpace(ExternalHostNameForLSL))
142 {
143 m_ErrorStr = "ExternalHostNameForLSL not defined in configuration, HTTP listener for LSL disabled";
144 m_log.Warn("[URL MODULE]: " + m_ErrorStr);
145 return;
146 }
147
148 IPAddress ia = null;
149 try
150 {
151 foreach (IPAddress Adr in Dns.GetHostAddresses(ExternalHostNameForLSL))
152 {
153 if (Adr.AddressFamily == AddressFamily.InterNetwork ||
154 Adr.AddressFamily == AddressFamily.InterNetworkV6) // ipv6 will most likely smoke
155 {
156 ia = Adr;
157 break;
158 }
159 }
160 }
161 catch
162 {
163 ia = null;
164 }
131 165
132 if (ExternalHostNameForLSL == null) 166 if (ia == null)
133 ExternalHostNameForLSL = System.Environment.MachineName; 167 {
168 m_ErrorStr = "Could not resolve ExternalHostNameForLSL, HTTP listener for LSL disabled";
169 m_log.Warn("[URL MODULE]: " + m_ErrorStr);
170 return;
171 }
172
173 m_enabled = true;
174 m_ErrorStr = String.Empty;
134 175
135 IConfig llFunctionsConfig = config.Configs["LL-Functions"]; 176 IConfig llFunctionsConfig = config.Configs["LL-Functions"];
136 177
@@ -146,7 +187,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
146 187
147 public void AddRegion(Scene scene) 188 public void AddRegion(Scene scene)
148 { 189 {
149 if (m_HttpServer == null) 190 if (m_enabled && m_HttpServer == null)
150 { 191 {
151 // There can only be one 192 // There can only be one
152 // 193 //
@@ -197,11 +238,18 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
197 { 238 {
198 UUID urlcode = UUID.Random(); 239 UUID urlcode = UUID.Random();
199 240
241 if(!m_enabled)
242 {
243 engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", m_ErrorStr });
244 return urlcode;
245 }
246
200 lock (m_UrlMap) 247 lock (m_UrlMap)
201 { 248 {
202 if (m_UrlMap.Count >= TotalUrls) 249 if (m_UrlMap.Count >= TotalUrls)
203 { 250 {
204 engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" }); 251 engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED",
252 "Too many URLs already open" });
205 return urlcode; 253 return urlcode;
206 } 254 }
207 string url = "http://" + ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + "/lslhttp/" + urlcode.ToString() + "/"; 255 string url = "http://" + ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + "/lslhttp/" + urlcode.ToString() + "/";
@@ -243,6 +291,12 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
243 { 291 {
244 UUID urlcode = UUID.Random(); 292 UUID urlcode = UUID.Random();
245 293
294 if(!m_enabled)
295 {
296 engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", m_ErrorStr });
297 return urlcode;
298 }
299
246 if (m_HttpsServer == null) 300 if (m_HttpsServer == null)
247 { 301 {
248 engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" }); 302 engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" });
@@ -253,7 +307,8 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
253 { 307 {
254 if (m_UrlMap.Count >= TotalUrls) 308 if (m_UrlMap.Count >= TotalUrls)
255 { 309 {
256 engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" }); 310 engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED",
311 "Too many URLs already open" });
257 return urlcode; 312 return urlcode;
258 } 313 }
259 string url = "https://" + ExternalHostNameForLSL + ":" + m_HttpsServer.Port.ToString() + "/lslhttps/" + urlcode.ToString() + "/"; 314 string url = "https://" + ExternalHostNameForLSL + ":" + m_HttpsServer.Port.ToString() + "/lslhttps/" + urlcode.ToString() + "/";
diff --git a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs
index 660e03f..a5203ea 100644
--- a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs
+++ b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs
@@ -113,7 +113,7 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm
113 // wrap this in a try block so that defaults will work if 113 // wrap this in a try block so that defaults will work if
114 // the config file doesn't specify otherwise. 114 // the config file doesn't specify otherwise.
115 int maxlisteners = 1000; 115 int maxlisteners = 1000;
116 int maxhandles = 64; 116 int maxhandles = 65;
117 try 117 try
118 { 118 {
119 m_whisperdistance = config.Configs["Chat"].GetInt( 119 m_whisperdistance = config.Configs["Chat"].GetInt(
@@ -130,8 +130,15 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm
130 catch (Exception) 130 catch (Exception)
131 { 131 {
132 } 132 }
133 if (maxlisteners < 1) maxlisteners = int.MaxValue; 133
134 if (maxhandles < 1) maxhandles = int.MaxValue; 134 if (maxlisteners < 1)
135 maxlisteners = int.MaxValue;
136 if (maxhandles < 1)
137 maxhandles = int.MaxValue;
138
139 if (maxlisteners < maxhandles)
140 maxlisteners = maxhandles;
141
135 m_listenerManager = new ListenerManager(maxlisteners, maxhandles); 142 m_listenerManager = new ListenerManager(maxlisteners, maxhandles);
136 m_pendingQ = new Queue(); 143 m_pendingQ = new Queue();
137 m_pending = Queue.Synchronized(m_pendingQ); 144 m_pending = Queue.Synchronized(m_pendingQ);
@@ -605,11 +612,9 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm
605 li.GetHandle().Equals(handle)) 612 li.GetHandle().Equals(handle))
606 { 613 {
607 lis.Value.Remove(li); 614 lis.Value.Remove(li);
615 m_curlisteners--;
608 if (lis.Value.Count == 0) 616 if (lis.Value.Count == 0)
609 { 617 m_listeners.Remove(lis.Key); // bailing of loop so this does not smoke
610 m_listeners.Remove(lis.Key);
611 m_curlisteners--;
612 }
613 // there should be only one, so we bail out early 618 // there should be only one, so we bail out early
614 return; 619 return;
615 } 620 }
@@ -718,6 +723,9 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm
718 } 723 }
719 } 724 }
720 725
726 if(handles.Count >= m_maxhandles)
727 return -1;
728
721 // Note: 0 is NOT a valid handle for llListen() to return 729 // Note: 0 is NOT a valid handle for llListen() to return
722 for (int i = 1; i <= m_maxhandles; i++) 730 for (int i = 1; i <= m_maxhandles; i++)
723 { 731 {
diff --git a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
index a7a9d1d..6a8f4c0 100644
--- a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
+++ b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
@@ -146,7 +146,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell
146 child.TriggerScriptChangedEvent(Changed.OWNER); 146 child.TriggerScriptChangedEvent(Changed.OWNER);
147 child.ApplyNextOwnerPermissions(); 147 child.ApplyNextOwnerPermissions();
148 } 148 }
149 group.AggregatePerms(); 149 group.InvalidateDeepEffectivePerms();
150 } 150 }
151 151
152 part.ObjectSaleType = 0; 152 part.ObjectSaleType = 0;
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index 18d164f..45c1c56 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -293,6 +293,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
293 scenePermissions.OnDeleteObject += CanDeleteObject; 293 scenePermissions.OnDeleteObject += CanDeleteObject;
294 scenePermissions.OnEditObjectByIDs += CanEditObjectByIDs; 294 scenePermissions.OnEditObjectByIDs += CanEditObjectByIDs;
295 scenePermissions.OnEditObject += CanEditObject; 295 scenePermissions.OnEditObject += CanEditObject;
296 scenePermissions.OnEditObjectPerms += CanEditObjectPerms;
296 scenePermissions.OnInventoryTransfer += CanInventoryTransfer; 297 scenePermissions.OnInventoryTransfer += CanInventoryTransfer;
297 scenePermissions.OnMoveObject += CanMoveObject; 298 scenePermissions.OnMoveObject += CanMoveObject;
298 scenePermissions.OnTakeObject += CanTakeObject; 299 scenePermissions.OnTakeObject += CanTakeObject;
@@ -391,6 +392,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
391 scenePermissions.OnDeleteObject -= CanDeleteObject; 392 scenePermissions.OnDeleteObject -= CanDeleteObject;
392 scenePermissions.OnEditObjectByIDs -= CanEditObjectByIDs; 393 scenePermissions.OnEditObjectByIDs -= CanEditObjectByIDs;
393 scenePermissions.OnEditObject -= CanEditObject; 394 scenePermissions.OnEditObject -= CanEditObject;
395 scenePermissions.OnEditObjectPerms -= CanEditObjectPerms;
394 scenePermissions.OnInventoryTransfer -= CanInventoryTransfer; 396 scenePermissions.OnInventoryTransfer -= CanInventoryTransfer;
395 scenePermissions.OnMoveObject -= CanMoveObject; 397 scenePermissions.OnMoveObject -= CanMoveObject;
396 scenePermissions.OnTakeObject -= CanTakeObject; 398 scenePermissions.OnTakeObject -= CanTakeObject;
@@ -1387,6 +1389,35 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1387 return true; 1389 return true;
1388 } 1390 }
1389 1391
1392 private bool CanEditObjectPerms(SceneObjectGroup sog, UUID userID)
1393 {
1394 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
1395 if (m_bypassPermissions) return m_bypassPermissionsValue;
1396
1397 if (sog == null)
1398 return false;
1399
1400 if(sog.OwnerID == userID || IsAdministrator(userID))
1401 return true;
1402
1403 UUID sogGroupID = sog.GroupID;
1404 if(sogGroupID == UUID.Zero || sogGroupID != sog.OwnerID)
1405 return false;
1406
1407 uint perms = sog.EffectiveOwnerPerms;
1408 if((perms & (uint)PermissionMask.Modify) == 0)
1409 return false;
1410
1411 ulong powers = 0;
1412 if(GroupMemberPowers(sogGroupID, userID, ref powers))
1413 {
1414 if((powers & (ulong)GroupPowers.ObjectManipulate) != 0)
1415 return true;
1416 }
1417
1418 return false;
1419 }
1420
1390 private bool CanEditObjectInventory(UUID objectID, UUID userID) 1421 private bool CanEditObjectInventory(UUID objectID, UUID userID)
1391 { 1422 {
1392 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 1423 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
@@ -1678,7 +1709,6 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1678 return false; 1709 return false;
1679 } 1710 }
1680 1711
1681
1682 private bool CanReturnObjects(ILandObject land, ScenePresence sp, List<SceneObjectGroup> objects) 1712 private bool CanReturnObjects(ILandObject land, ScenePresence sp, List<SceneObjectGroup> objects)
1683 { 1713 {
1684 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 1714 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
@@ -2289,23 +2319,31 @@ namespace OpenSim.Region.CoreModules.World.Permissions
2289 if (sog == null) 2319 if (sog == null)
2290 return false; 2320 return false;
2291 2321
2292 uint perms = GetObjectPermissions(userID, sog, true); 2322 if(sog.OwnerID == userID || IsAdministrator(userID))
2293 if((perms & (uint)PermissionMask.Modify) == 0) 2323 return true;
2294 return false; 2324
2295 2325 if(sog.IsAttachment)
2296 TaskInventoryItem ti = part.Inventory.GetInventoryItem(itemID);
2297 if(ti == null)
2298 return false; 2326 return false;
2299 2327
2300 uint itperms = GetObjectItemPermissions(userID, ti); 2328 UUID sogGroupID = sog.GroupID;
2301 2329
2302 if((itperms & (uint)PermissionMask.Copy) == 0) 2330 if(sogGroupID == UUID.Zero || sogGroupID != sog.OwnerID)
2303 return false; 2331 return false;
2304 2332
2305 if(sog.OwnerID != userID && (itperms & (uint)PermissionMask.Transfer) == 0) 2333 TaskInventoryItem ti = part.Inventory.GetInventoryItem(itemID);
2334 if(ti == null)
2306 return false; 2335 return false;
2307 2336
2308 return true; 2337 ulong powers = 0;
2338 if(GroupMemberPowers(sogGroupID, userID, ref powers))
2339 {
2340 if((powers & (ulong)GroupPowers.ObjectManipulate) != 0)
2341 return true;
2342
2343 if((ti.EveryonePermissions & (uint)PermissionMask.Copy) != 0)
2344 return true;
2345 }
2346 return false;
2309 } 2347 }
2310 2348
2311 // object inventory to object inventory item drag and drop 2349 // object inventory to object inventory item drag and drop
diff --git a/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs b/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs
index 167f6b5..4cee7a5 100644
--- a/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs
+++ b/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs
@@ -107,7 +107,7 @@ namespace OpenSim.Region.CoreModules.World.Vegetation
107 107
108 sceneObject.SetGroup(groupID, null); 108 sceneObject.SetGroup(groupID, null);
109 m_scene.AddNewSceneObject(sceneObject, true); 109 m_scene.AddNewSceneObject(sceneObject, true);
110 sceneObject.AggregatePerms(); 110 sceneObject.InvalidateDeepEffectivePerms();
111 111
112 return sceneObject; 112 return sceneObject;
113 } 113 }
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index afdd99e..bba7a96 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -338,7 +338,7 @@ namespace OpenSim.Region.Framework.Scenes
338 // Update item with new asset 338 // Update item with new asset
339 item.AssetID = asset.FullID; 339 item.AssetID = asset.FullID;
340 group.UpdateInventoryItem(item); 340 group.UpdateInventoryItem(item);
341 group.AggregatePerms(); 341 group.InvalidateEffectivePerms();
342 342
343 part.SendPropertiesToClient(remoteClient); 343 part.SendPropertiesToClient(remoteClient);
344 344
@@ -1216,7 +1216,7 @@ namespace OpenSim.Region.Framework.Scenes
1216 } 1216 }
1217 1217
1218 group.RemoveInventoryItem(localID, itemID); 1218 group.RemoveInventoryItem(localID, itemID);
1219 group.AggregatePerms(); 1219 group.InvalidateEffectivePerms();
1220 } 1220 }
1221 1221
1222 part.SendPropertiesToClient(remoteClient); 1222 part.SendPropertiesToClient(remoteClient);
@@ -1388,11 +1388,7 @@ namespace OpenSim.Region.Framework.Scenes
1388 } 1388 }
1389 1389
1390 if (!Permissions.CanCopyObjectInventory(itemId, part.UUID, remoteClient.AgentId)) 1390 if (!Permissions.CanCopyObjectInventory(itemId, part.UUID, remoteClient.AgentId))
1391 { 1391 return;
1392 // check also if we can delete the no copy item
1393 if(!Permissions.CanEditObject(part.UUID, remoteClient.AgentId))
1394 return;
1395 }
1396 1392
1397 string message; 1393 string message;
1398 InventoryItemBase item = MoveTaskInventoryItem(remoteClient, folderId, part, itemId, out message); 1394 InventoryItemBase item = MoveTaskInventoryItem(remoteClient, folderId, part, itemId, out message);
@@ -1742,8 +1738,25 @@ namespace OpenSim.Region.Framework.Scenes
1742 // Check if we're allowed to mess with permissions 1738 // Check if we're allowed to mess with permissions
1743 if (!Permissions.IsGod(remoteClient.AgentId)) // Not a god 1739 if (!Permissions.IsGod(remoteClient.AgentId)) // Not a god
1744 { 1740 {
1741 bool noChange;
1745 if (remoteClient.AgentId != part.OwnerID) // Not owner 1742 if (remoteClient.AgentId != part.OwnerID) // Not owner
1746 { 1743 {
1744 noChange = true;
1745 if(itemInfo.OwnerID == UUID.Zero && itemInfo.GroupID != UUID.Zero)
1746 {
1747 if(remoteClient.IsGroupMember(itemInfo.GroupID))
1748 {
1749 ulong powers = remoteClient.GetGroupPowers(itemInfo.GroupID);
1750 if((powers & (ulong)GroupPowers.ObjectManipulate) != 0)
1751 noChange = false;
1752 }
1753 }
1754 }
1755 else
1756 noChange = false;
1757
1758 if(noChange)
1759 {
1747 // Friends and group members can't change any perms 1760 // Friends and group members can't change any perms
1748 itemInfo.BasePermissions = currentItem.BasePermissions; 1761 itemInfo.BasePermissions = currentItem.BasePermissions;
1749 itemInfo.EveryonePermissions = currentItem.EveryonePermissions; 1762 itemInfo.EveryonePermissions = currentItem.EveryonePermissions;
@@ -1769,7 +1782,6 @@ namespace OpenSim.Region.Framework.Scenes
1769 itemInfo.CurrentPermissions &= currentItem.BasePermissions; 1782 itemInfo.CurrentPermissions &= currentItem.BasePermissions;
1770 itemInfo.NextPermissions &= currentItem.BasePermissions; 1783 itemInfo.NextPermissions &= currentItem.BasePermissions;
1771 } 1784 }
1772
1773 } 1785 }
1774 else 1786 else
1775 { 1787 {
@@ -1955,7 +1967,7 @@ namespace OpenSim.Region.Framework.Scenes
1955 part.Inventory.AddInventoryItem(taskItem, false); 1967 part.Inventory.AddInventoryItem(taskItem, false);
1956 part.Inventory.CreateScriptInstance(taskItem, 0, false, DefaultScriptEngine, 0); 1968 part.Inventory.CreateScriptInstance(taskItem, 0, false, DefaultScriptEngine, 0);
1957 1969
1958 part.ParentGroup.AggregatePerms(); 1970 part.ParentGroup.InvalidateEffectivePerms();
1959 1971
1960 // tell anyone managing scripts that a new script exists 1972 // tell anyone managing scripts that a new script exists
1961 EventManager.TriggerNewScript(agentID, part, taskItem.ItemID); 1973 EventManager.TriggerNewScript(agentID, part, taskItem.ItemID);
@@ -2643,7 +2655,7 @@ namespace OpenSim.Region.Framework.Scenes
2643 2655
2644 // We can only call this after adding the scene object, since the scene object references the scene 2656 // We can only call this after adding the scene object, since the scene object references the scene
2645 // to find out if scripts should be activated at all. 2657 // to find out if scripts should be activated at all.
2646 group.AggregatePerms(); 2658 group.InvalidateEffectivePerms();
2647 group.CreateScriptInstances(param, true, DefaultScriptEngine, 3); 2659 group.CreateScriptInstances(param, true, DefaultScriptEngine, 3);
2648 2660
2649 group.ScheduleGroupForFullUpdate(); 2661 group.ScheduleGroupForFullUpdate();
@@ -2740,7 +2752,7 @@ namespace OpenSim.Region.Framework.Scenes
2740 // and with this comented code, if user does not set next permissions on the object 2752 // and with this comented code, if user does not set next permissions on the object
2741 // and on ALL contents of ALL prims, he may loose rights, making the object useless 2753 // and on ALL contents of ALL prims, he may loose rights, making the object useless
2742 sog.ApplyNextOwnerPermissions(); 2754 sog.ApplyNextOwnerPermissions();
2743 sog.AggregatePerms(); 2755 sog.InvalidateEffectivePerms();
2744 2756
2745 sog.ScheduleGroupForFullUpdate(); 2757 sog.ScheduleGroupForFullUpdate();
2746 2758
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
index c55a7a6..a75671e 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
@@ -53,6 +53,7 @@ namespace OpenSim.Region.Framework.Scenes
53 public delegate bool DuplicateObjectHandler(SceneObjectGroup sog, ScenePresence sp); 53 public delegate bool DuplicateObjectHandler(SceneObjectGroup sog, ScenePresence sp);
54 public delegate bool EditObjectByIDsHandler(UUID objectID, UUID editorID); 54 public delegate bool EditObjectByIDsHandler(UUID objectID, UUID editorID);
55 public delegate bool EditObjectHandler(SceneObjectGroup sog, ScenePresence sp); 55 public delegate bool EditObjectHandler(SceneObjectGroup sog, ScenePresence sp);
56 public delegate bool EditObjectPermsHandler(SceneObjectGroup sog, UUID editorID);
56 public delegate bool EditObjectInventoryHandler(UUID objectID, UUID editorID); 57 public delegate bool EditObjectInventoryHandler(UUID objectID, UUID editorID);
57 public delegate bool MoveObjectHandler(SceneObjectGroup sog, ScenePresence sp); 58 public delegate bool MoveObjectHandler(SceneObjectGroup sog, ScenePresence sp);
58 public delegate bool ObjectEntryHandler(SceneObjectGroup sog, bool enteringRegion, Vector3 newPoint); 59 public delegate bool ObjectEntryHandler(SceneObjectGroup sog, bool enteringRegion, Vector3 newPoint);
@@ -133,6 +134,7 @@ namespace OpenSim.Region.Framework.Scenes
133 public event DuplicateObjectHandler OnDuplicateObject; 134 public event DuplicateObjectHandler OnDuplicateObject;
134 public event EditObjectByIDsHandler OnEditObjectByIDs; 135 public event EditObjectByIDsHandler OnEditObjectByIDs;
135 public event EditObjectHandler OnEditObject; 136 public event EditObjectHandler OnEditObject;
137 public event EditObjectPermsHandler OnEditObjectPerms;
136 public event EditObjectInventoryHandler OnEditObjectInventory; 138 public event EditObjectInventoryHandler OnEditObjectInventory;
137 public event MoveObjectHandler OnMoveObject; 139 public event MoveObjectHandler OnMoveObject;
138 public event ObjectEntryHandler OnObjectEntry; 140 public event ObjectEntryHandler OnObjectEntry;
@@ -511,6 +513,24 @@ namespace OpenSim.Region.Framework.Scenes
511 return true; 513 return true;
512 } 514 }
513 515
516 public bool CanEditObjectPermissions(SceneObjectGroup sog, UUID editorID)
517 {
518 EditObjectPermsHandler handler = OnEditObjectPerms;
519 if (handler != null)
520 {
521 if(sog == null)
522 return false;
523 Delegate[] list = handler.GetInvocationList();
524 foreach (EditObjectPermsHandler h in list)
525 {
526 if (h(sog, editorID) == false)
527 return false;
528 }
529 }
530 return true;
531 }
532
533
514 public bool CanEditObjectInventory(UUID objectID, UUID editorID) 534 public bool CanEditObjectInventory(UUID objectID, UUID editorID)
515 { 535 {
516 EditObjectInventoryHandler handler = OnEditObjectInventory; 536 EditObjectInventoryHandler handler = OnEditObjectInventory;
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 715ae5c..e709d6c 100755
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -978,6 +978,7 @@ namespace OpenSim.Region.Framework.Scenes
978 m_maxDrawDistance = startupConfig.GetFloat("MaxDrawDistance", m_maxDrawDistance); 978 m_maxDrawDistance = startupConfig.GetFloat("MaxDrawDistance", m_maxDrawDistance);
979 m_maxRegionViewDistance = startupConfig.GetFloat("MaxRegionsViewDistance", m_maxRegionViewDistance); 979 m_maxRegionViewDistance = startupConfig.GetFloat("MaxRegionsViewDistance", m_maxRegionViewDistance);
980 980
981 // old versions compatibility
981 LegacySitOffsets = startupConfig.GetBoolean("LegacySitOffsets", LegacySitOffsets); 982 LegacySitOffsets = startupConfig.GetBoolean("LegacySitOffsets", LegacySitOffsets);
982 983
983 if (m_defaultDrawDistance > m_maxDrawDistance) 984 if (m_defaultDrawDistance > m_maxDrawDistance)
@@ -2390,8 +2391,9 @@ namespace OpenSim.Region.Framework.Scenes
2390 EventManager.TriggerOnSceneObjectLoaded(group); 2391 EventManager.TriggerOnSceneObjectLoaded(group);
2391 SceneObjectPart rootPart = group.GetPart(group.UUID); 2392 SceneObjectPart rootPart = group.GetPart(group.UUID);
2392 rootPart.Flags &= ~PrimFlags.Scripted; 2393 rootPart.Flags &= ~PrimFlags.Scripted;
2393 group.AggregateDeepPerms(); 2394
2394 rootPart.TrimPermissions(); 2395 rootPart.TrimPermissions();
2396 group.InvalidateDeepEffectivePerms();
2395 2397
2396 // Don't do this here - it will get done later on when sculpt data is loaded. 2398 // Don't do this here - it will get done later on when sculpt data is loaded.
2397 // group.CheckSculptAndLoad(); 2399 // group.CheckSculptAndLoad();
@@ -2662,7 +2664,7 @@ namespace OpenSim.Region.Framework.Scenes
2662 if (UserManagementModule != null) 2664 if (UserManagementModule != null)
2663 sceneObject.RootPart.CreatorIdentification = UserManagementModule.GetUserUUI(ownerID); 2665 sceneObject.RootPart.CreatorIdentification = UserManagementModule.GetUserUUI(ownerID);
2664 2666
2665 sceneObject.AggregateDeepPerms(); 2667 sceneObject.InvalidateDeepEffectivePerms();;
2666 sceneObject.ScheduleGroupForFullUpdate(); 2668 sceneObject.ScheduleGroupForFullUpdate();
2667 2669
2668 return sceneObject; 2670 return sceneObject;
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index a005068..117d92d 100755
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -343,7 +343,7 @@ namespace OpenSim.Region.Framework.Scenes
343 sceneObject.ForceInventoryPersistence(); 343 sceneObject.ForceInventoryPersistence();
344 sceneObject.HasGroupChanged = true; 344 sceneObject.HasGroupChanged = true;
345 } 345 }
346 sceneObject.AggregateDeepPerms(); 346 sceneObject.InvalidateDeepEffectivePerms();
347 return ret; 347 return ret;
348 } 348 }
349 349
@@ -2094,7 +2094,7 @@ namespace OpenSim.Region.Framework.Scenes
2094 child.TriggerScriptChangedEvent(Changed.OWNER); 2094 child.TriggerScriptChangedEvent(Changed.OWNER);
2095 child.ApplyNextOwnerPermissions(); 2095 child.ApplyNextOwnerPermissions();
2096 } 2096 }
2097 copy.AggregatePerms(); 2097 copy.InvalidateEffectivePerms();
2098 } 2098 }
2099 } 2099 }
2100 2100
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
index 36844a9..f778367 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
@@ -183,7 +183,7 @@ namespace OpenSim.Region.Framework.Scenes
183 addFromAllowedDrop = (part.ParentGroup.RootPart.GetEffectiveObjectFlags() & (uint)PrimFlags.AllowInventoryDrop) != 0; 183 addFromAllowedDrop = (part.ParentGroup.RootPart.GetEffectiveObjectFlags() & (uint)PrimFlags.AllowInventoryDrop) != 0;
184 184
185 part.Inventory.AddInventoryItem(taskItem, addFromAllowedDrop); 185 part.Inventory.AddInventoryItem(taskItem, addFromAllowedDrop);
186 part.ParentGroup.AggregatePerms(); 186 part.ParentGroup.InvalidateEffectivePerms();
187 return true; 187 return true;
188 188
189 } 189 }
@@ -254,13 +254,26 @@ namespace OpenSim.Region.Framework.Scenes
254 // new test code, to place in better place later 254 // new test code, to place in better place later
255 private object m_PermissionsLock = new object(); 255 private object m_PermissionsLock = new object();
256 private bool m_EffectivePermsInvalid = true; 256 private bool m_EffectivePermsInvalid = true;
257 private bool m_DeepEffectivePermsInvalid = true;
257 258
259 // should called when parts chanced by their contents did not, so we know their cacche is valid
260 // in case of doubt call InvalidateDeepEffectivePerms(), it only costs a bit more cpu time
258 public void InvalidateEffectivePerms() 261 public void InvalidateEffectivePerms()
259 { 262 {
260 lock(m_PermissionsLock) 263 lock(m_PermissionsLock)
261 m_EffectivePermsInvalid = true; 264 m_EffectivePermsInvalid = true;
262 } 265 }
263 266
267 // should called when parts chanced and their contents where accounted for
268 public void InvalidateDeepEffectivePerms()
269 {
270 lock(m_PermissionsLock)
271 {
272 m_DeepEffectivePermsInvalid = true;
273 m_EffectivePermsInvalid = true;
274 }
275 }
276
264 private uint m_EffectiveEveryOnePerms; 277 private uint m_EffectiveEveryOnePerms;
265 public uint EffectiveEveryOnePerms 278 public uint EffectiveEveryOnePerms
266 { 279 {
@@ -317,79 +330,6 @@ namespace OpenSim.Region.Framework.Scenes
317 } 330 }
318 } 331 }
319 332
320 // aggregates perms scanning parts and their contents
321 // AggregatePerms does same using cached parts content perms
322 public void AggregateDeepPerms()
323 {
324 lock(m_PermissionsLock)
325 {
326 // aux
327 const uint allmask = (uint)PermissionMask.AllEffective;
328 const uint movemodmask = (uint)(PermissionMask.Move | PermissionMask.Modify);
329 const uint copytransfermask = (uint)(PermissionMask.Copy | PermissionMask.Transfer);
330
331 uint basePerms = (RootPart.BaseMask & allmask) | (uint)PermissionMask.Move;
332 bool noBaseTransfer = (basePerms & (uint)PermissionMask.Transfer) == 0;
333
334 uint rootOwnerPerms = RootPart.OwnerMask;
335 uint owner = rootOwnerPerms;
336 uint rootGroupPerms = RootPart.GroupMask;
337 uint group = rootGroupPerms;
338 uint rootEveryonePerms = RootPart.EveryoneMask;
339 uint everyone = rootEveryonePerms;
340
341 // date is time of writing april 30th 2017
342 bool newObject = (RootPart.CreationDate == 0 || RootPart.CreationDate > 1493574994);
343 SceneObjectPart[] parts = m_parts.GetArray();
344 for (int i = 0; i < parts.Length; i++)
345 {
346 SceneObjectPart part = parts[i];
347 part.AggregateInnerPerms();
348 owner &= part.AggregatedInnerOwnerPerms;
349 group &= part.AggregatedInnerGroupPerms;
350 if(newObject)
351 everyone &= part.AggregatedInnerEveryonePerms;
352 }
353 // recover modify and move
354 rootOwnerPerms &= movemodmask;
355 owner |= rootOwnerPerms;
356 if((owner & copytransfermask) == 0)
357 owner |= (uint)PermissionMask.Transfer;
358
359 owner &= basePerms;
360 m_EffectiveOwnerPerms = owner;
361 uint ownertransfermask = owner & (uint)PermissionMask.Transfer;
362
363 // recover modify and move
364 rootGroupPerms &= movemodmask;
365 group |= rootGroupPerms;
366 if(noBaseTransfer)
367 group &=~(uint)PermissionMask.Copy;
368 else
369 group |= ownertransfermask;
370
371 uint groupOrEveryone = group;
372 m_EffectiveGroupPerms = group & owner;
373
374 // recover move
375 rootEveryonePerms &= (uint)PermissionMask.Move;
376 everyone |= rootEveryonePerms;
377 everyone &= ~(uint)PermissionMask.Modify;
378 if(noBaseTransfer)
379 everyone &=~(uint)PermissionMask.Copy;
380 else
381 everyone |= ownertransfermask;
382
383 groupOrEveryone |= everyone;
384
385 m_EffectiveEveryOnePerms = everyone & owner;
386 m_EffectiveGroupOrEveryOnePerms = groupOrEveryone & owner;
387 m_EffectivePermsInvalid = false;
388 }
389 }
390
391 // aggregates perms scanning parts, assuming their contents was already aggregated and cached
392 // ie is AggregateDeepPerms without the part.AggregateInnerPerms() call on parts loop
393 public void AggregatePerms() 333 public void AggregatePerms()
394 { 334 {
395 lock(m_PermissionsLock) 335 lock(m_PermissionsLock)
@@ -411,14 +351,20 @@ namespace OpenSim.Region.Framework.Scenes
411 351
412 bool needUpdate = false; 352 bool needUpdate = false;
413 // date is time of writing april 30th 2017 353 // date is time of writing april 30th 2017
414 bool newObject = (RootPart.CreationDate == 0 || RootPart.CreationDate > 1493574994); 354 bool newobj = (RootPart.CreationDate == 0 || RootPart.CreationDate > 1493574994);
415 SceneObjectPart[] parts = m_parts.GetArray(); 355 SceneObjectPart[] parts = m_parts.GetArray();
416 for (int i = 0; i < parts.Length; i++) 356 for (int i = 0; i < parts.Length; i++)
417 { 357 {
418 SceneObjectPart part = parts[i]; 358 SceneObjectPart part = parts[i];
359
360 if(m_DeepEffectivePermsInvalid)
361 part.AggregateInnerPerms();
362
419 owner &= part.AggregatedInnerOwnerPerms; 363 owner &= part.AggregatedInnerOwnerPerms;
420 group &= part.AggregatedInnerGroupPerms; 364 group &= part.AggregatedInnerGroupPerms;
421 if(newObject) 365 if(newobj)
366 group &= part.AggregatedInnerGroupPerms;
367 if(newobj)
422 everyone &= part.AggregatedInnerEveryonePerms; 368 everyone &= part.AggregatedInnerEveryonePerms;
423 } 369 }
424 // recover modify and move 370 // recover modify and move
@@ -477,6 +423,7 @@ namespace OpenSim.Region.Framework.Scenes
477 m_EffectiveGroupOrEveryOnePerms = tmpPerms; 423 m_EffectiveGroupOrEveryOnePerms = tmpPerms;
478 } 424 }
479 425
426 m_DeepEffectivePermsInvalid = false;
480 m_EffectivePermsInvalid = false; 427 m_EffectivePermsInvalid = false;
481 428
482 if(needUpdate) 429 if(needUpdate)
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index e73795e..93c9b42 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2677,7 +2677,7 @@ namespace OpenSim.Region.Framework.Scenes
2677 if (dupe.m_rootPart.PhysActor != null) 2677 if (dupe.m_rootPart.PhysActor != null)
2678 dupe.m_rootPart.PhysActor.Building = false; // tell physics to finish building 2678 dupe.m_rootPart.PhysActor.Building = false; // tell physics to finish building
2679 2679
2680 dupe.AggregateDeepPerms(); 2680 dupe.InvalidateDeepEffectivePerms();
2681 2681
2682 dupe.HasGroupChanged = true; 2682 dupe.HasGroupChanged = true;
2683 dupe.AttachToBackup(); 2683 dupe.AttachToBackup();
@@ -2943,7 +2943,7 @@ namespace OpenSim.Region.Framework.Scenes
2943 if (!m_scene.Permissions.BypassPermissions()) 2943 if (!m_scene.Permissions.BypassPermissions())
2944 { 2944 {
2945 ApplyNextOwnerPermissions(); 2945 ApplyNextOwnerPermissions();
2946 AggregatePerms(); 2946 InvalidateEffectivePerms();
2947 } 2947 }
2948 } 2948 }
2949 2949
@@ -3605,7 +3605,7 @@ namespace OpenSim.Region.Framework.Scenes
3605 3605
3606 InvalidBoundsRadius(); 3606 InvalidBoundsRadius();
3607 InvalidatePartsLinkMaps(); 3607 InvalidatePartsLinkMaps();
3608 objectGroup.AggregatePerms(); 3608 objectGroup.InvalidateEffectivePerms();
3609 3609
3610 if (sendEvents) 3610 if (sendEvents)
3611 linkPart.TriggerScriptChangedEvent(Changed.LINK); 3611 linkPart.TriggerScriptChangedEvent(Changed.LINK);
@@ -4163,7 +4163,7 @@ namespace OpenSim.Region.Framework.Scenes
4163// m_log.DebugFormat( 4163// m_log.DebugFormat(
4164// "[SCENE OBJECT GROUP]: RootPart.OwnerMask now {0} for {1} in {2}", 4164// "[SCENE OBJECT GROUP]: RootPart.OwnerMask now {0} for {1} in {2}",
4165// (OpenMetaverse.PermissionMask)RootPart.OwnerMask, Name, Scene.Name); 4165// (OpenMetaverse.PermissionMask)RootPart.OwnerMask, Name, Scene.Name);
4166 AggregatePerms(); 4166 InvalidateEffectivePerms();
4167 RootPart.ScheduleFullUpdate(); 4167 RootPart.ScheduleFullUpdate();
4168 } 4168 }
4169 4169
@@ -4188,7 +4188,7 @@ namespace OpenSim.Region.Framework.Scenes
4188 { 4188 {
4189 foreach (SceneObjectPart part in Parts) 4189 foreach (SceneObjectPart part in Parts)
4190 part.Inventory.ApplyGodPermissions(RootPart.BaseMask); 4190 part.Inventory.ApplyGodPermissions(RootPart.BaseMask);
4191 AggregatePerms(); 4191 InvalidateEffectivePerms();
4192 } 4192 }
4193 4193
4194 HasGroupChanged = true; 4194 HasGroupChanged = true;
@@ -5447,7 +5447,7 @@ namespace OpenSim.Region.Framework.Scenes
5447 { 5447 {
5448 part.ResetOwnerChangeFlag(); 5448 part.ResetOwnerChangeFlag();
5449 }); 5449 });
5450 AggregatePerms(); 5450 InvalidateEffectivePerms();
5451 } 5451 }
5452 5452
5453 // clear some references to easy cg 5453 // clear some references to easy cg
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index f948336..d980fe5 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -4460,8 +4460,11 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
4460 if (god) 4460 if (god)
4461 baseMask = 0x7ffffff0; 4461 baseMask = 0x7ffffff0;
4462 4462
4463 // Are we the owner? 4463 bool canChange = (AgentID == OwnerID) || god;
4464 if ((AgentID == OwnerID) || god) 4464 if(!canChange)
4465 canChange = ParentGroup.Scene.Permissions.CanEditObjectPermissions(ParentGroup, AgentID);
4466
4467 if (canChange)
4465 { 4468 {
4466 switch (field) 4469 switch (field)
4467 { 4470 {
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 946ed09..23da90a 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -207,6 +207,7 @@ namespace OpenSim.Region.Framework.Scenes
207 item.PermsGranter = UUID.Zero; 207 item.PermsGranter = UUID.Zero;
208 item.OwnerChanged = true; 208 item.OwnerChanged = true;
209 } 209 }
210 m_inventorySerial++;
210 m_items.LockItemsForWrite(false); 211 m_items.LockItemsForWrite(false);
211 } 212 }
212 213
@@ -222,7 +223,7 @@ namespace OpenSim.Region.Framework.Scenes
222 m_items.LockItemsForWrite(false); 223 m_items.LockItemsForWrite(false);
223 return; 224 return;
224 } 225 }
225 226 m_inventorySerial++;
226 // Don't let this set the HasGroupChanged flag for attachments 227 // Don't let this set the HasGroupChanged flag for attachments
227 // as this happens during rez and we don't want a new asset 228 // as this happens during rez and we don't want a new asset
228 // for each attachment each time 229 // for each attachment each time
@@ -235,10 +236,7 @@ namespace OpenSim.Region.Framework.Scenes
235 IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values); 236 IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values);
236 foreach (TaskInventoryItem item in items) 237 foreach (TaskInventoryItem item in items)
237 { 238 {
238 if (groupID != item.GroupID) 239 item.GroupID = groupID;
239 {
240 item.GroupID = groupID;
241 }
242 } 240 }
243 m_items.LockItemsForWrite(false); 241 m_items.LockItemsForWrite(false);
244 } 242 }
@@ -981,7 +979,7 @@ namespace OpenSim.Region.Framework.Scenes
981 } 979 }
982// old code end 980// old code end
983 rootPart.TrimPermissions(); 981 rootPart.TrimPermissions();
984 group.AggregateDeepPerms(); 982 group.InvalidateDeepEffectivePerms();
985 } 983 }
986 984
987 return true; 985 return true;
@@ -1019,6 +1017,9 @@ namespace OpenSim.Region.Framework.Scenes
1019 if (item.GroupPermissions != (uint)PermissionMask.None) 1017 if (item.GroupPermissions != (uint)PermissionMask.None)
1020 item.GroupID = m_part.GroupID; 1018 item.GroupID = m_part.GroupID;
1021 1019
1020 if(item.OwnerID == UUID.Zero) // viewer to internal enconding of group owned
1021 item.OwnerID = item.GroupID;
1022
1022 if (item.AssetID == UUID.Zero) 1023 if (item.AssetID == UUID.Zero)
1023 item.AssetID = m_items[item.ItemID].AssetID; 1024 item.AssetID = m_items[item.ItemID].AssetID;
1024 1025
@@ -1030,8 +1031,7 @@ namespace OpenSim.Region.Framework.Scenes
1030 1031
1031 if (considerChanged) 1032 if (considerChanged)
1032 { 1033 {
1033 m_part.AggregateInnerPerms(); 1034 m_part.ParentGroup.InvalidateDeepEffectivePerms();
1034 m_part.ParentGroup.AggregatePerms();
1035 HasInventoryChanged = true; 1035 HasInventoryChanged = true;
1036 m_part.ParentGroup.HasGroupChanged = true; 1036 m_part.ParentGroup.HasGroupChanged = true;
1037 } 1037 }
@@ -1074,8 +1074,7 @@ namespace OpenSim.Region.Framework.Scenes
1074 m_items.Remove(itemID); 1074 m_items.Remove(itemID);
1075 m_items.LockItemsForWrite(false); 1075 m_items.LockItemsForWrite(false);
1076 1076
1077 m_part.AggregateInnerPerms(); 1077 m_part.ParentGroup.InvalidateDeepEffectivePerms();
1078 m_part.ParentGroup.AggregatePerms();
1079 1078
1080 m_inventorySerial++; 1079 m_inventorySerial++;
1081 m_part.TriggerScriptChangedEvent(Changed.INVENTORY); 1080 m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
@@ -1179,6 +1178,7 @@ namespace OpenSim.Region.Framework.Scenes
1179 foreach (TaskInventoryItem item in m_items.Values) 1178 foreach (TaskInventoryItem item in m_items.Values)
1180 { 1179 {
1181 UUID ownerID = item.OwnerID; 1180 UUID ownerID = item.OwnerID;
1181 UUID groupID = item.GroupID;
1182 uint everyoneMask = item.EveryonePermissions; 1182 uint everyoneMask = item.EveryonePermissions;
1183 uint baseMask = item.BasePermissions; 1183 uint baseMask = item.BasePermissions;
1184 uint ownerMask = item.CurrentPermissions; 1184 uint ownerMask = item.CurrentPermissions;
@@ -1197,11 +1197,21 @@ namespace OpenSim.Region.Framework.Scenes
1197 invString.AddNameValueLine("next_owner_mask", Utils.UIntToHexString(item.NextPermissions)); 1197 invString.AddNameValueLine("next_owner_mask", Utils.UIntToHexString(item.NextPermissions));
1198 1198
1199 invString.AddNameValueLine("creator_id", item.CreatorID.ToString()); 1199 invString.AddNameValueLine("creator_id", item.CreatorID.ToString());
1200 invString.AddNameValueLine("owner_id", ownerID.ToString());
1201 1200
1202 invString.AddNameValueLine("last_owner_id", item.LastOwnerID.ToString()); 1201 invString.AddNameValueLine("last_owner_id", item.LastOwnerID.ToString());
1203 1202
1204 invString.AddNameValueLine("group_id", item.GroupID.ToString()); 1203 invString.AddNameValueLine("group_id",groupID.ToString());
1204 if(groupID != UUID.Zero && ownerID == groupID)
1205 {
1206 invString.AddNameValueLine("owner_id", UUID.Zero.ToString());
1207 invString.AddNameValueLine("group_owned","1");
1208 }
1209 else
1210 {
1211 invString.AddNameValueLine("owner_id", ownerID.ToString());
1212 invString.AddNameValueLine("group_owned","0");
1213 }
1214
1205 invString.AddSectionEnd(); 1215 invString.AddSectionEnd();
1206 1216
1207 if (includeAssets) 1217 if (includeAssets)
@@ -1351,19 +1361,26 @@ namespace OpenSim.Region.Framework.Scenes
1351 if(item.InvType == (sbyte)InventoryType.Landmark) 1361 if(item.InvType == (sbyte)InventoryType.Landmark)
1352 continue; 1362 continue;
1353 1363
1354 if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Copy) == 0) 1364 // apply current to normal permission bits
1355 mask &= ~((uint)PermissionMask.FoldedCopy); 1365 uint newperms = item.CurrentPermissions;
1356 if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Transfer) == 0)
1357 mask &= ~((uint)PermissionMask.FoldedTransfer);
1358 if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Export) == 0)
1359 mask &= ~((uint)PermissionMask.FoldedExport);
1360 1366
1361 if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) 1367 if ((newperms & (uint)PermissionMask.Copy) == 0)
1362 mask &= ~(uint)PermissionMask.Copy; 1368 mask &= ~(uint)PermissionMask.Copy;
1363 if ((item.CurrentPermissions & (uint)PermissionMask.Transfer) == 0) 1369 if ((newperms & (uint)PermissionMask.Transfer) == 0)
1364 mask &= ~(uint)PermissionMask.Transfer; 1370 mask &= ~(uint)PermissionMask.Transfer;
1365 if ((item.CurrentPermissions & (uint)PermissionMask.Export) == 0) 1371 if ((newperms & (uint)PermissionMask.Export) == 0)
1366 mask &= ~((uint)PermissionMask.Export); 1372 mask &= ~((uint)PermissionMask.Export);
1373
1374 // apply next owner restricted by current to folded bits
1375 newperms &= item.NextPermissions;
1376
1377 if ((newperms & (uint)PermissionMask.Copy) == 0)
1378 mask &= ~((uint)PermissionMask.FoldedCopy);
1379 if ((newperms & (uint)PermissionMask.Transfer) == 0)
1380 mask &= ~((uint)PermissionMask.FoldedTransfer);
1381 if ((newperms & (uint)PermissionMask.Export) == 0)
1382 mask &= ~((uint)PermissionMask.FoldedExport);
1383
1367 } 1384 }
1368 return mask; 1385 return mask;
1369 } 1386 }
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
index 87d1ace..892403b 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
@@ -114,7 +114,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
114 // Script state may, or may not, exist. Not having any, is NOT 114 // Script state may, or may not, exist. Not having any, is NOT
115 // ever a problem. 115 // ever a problem.
116 sceneObject.LoadScriptState(reader); 116 sceneObject.LoadScriptState(reader);
117 sceneObject.AggregateDeepPerms(); 117 sceneObject.InvalidateDeepEffectivePerms();
118 return sceneObject; 118 return sceneObject;
119 } 119 }
120 120
@@ -278,7 +278,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
278 // Script state may, or may not, exist. Not having any, is NOT 278 // Script state may, or may not, exist. Not having any, is NOT
279 // ever a problem. 279 // ever a problem.
280 sceneObject.LoadScriptState(doc); 280 sceneObject.LoadScriptState(doc);
281 sceneObject.AggregatePerms(); 281// sceneObject.AggregatePerms();
282 return sceneObject; 282 return sceneObject;
283 } 283 }
284 catch (Exception e) 284 catch (Exception e)
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs
index 0f022dd..34fdb6d 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs
@@ -70,7 +70,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
70 //obj.RegenerateFullIDs(); 70 //obj.RegenerateFullIDs();
71 71
72 scene.AddNewSceneObject(obj, true); 72 scene.AddNewSceneObject(obj, true);
73 obj.AggregateDeepPerms(); 73 obj.InvalidateDeepEffectivePerms();
74 } 74 }
75 } 75 }
76 else 76 else
diff --git a/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs b/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs
index 92b5831..c3f3851 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs
@@ -174,7 +174,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
174 child.TriggerScriptChangedEvent(Changed.OWNER); 174 child.TriggerScriptChangedEvent(Changed.OWNER);
175 child.ApplyNextOwnerPermissions(); 175 child.ApplyNextOwnerPermissions();
176 } 176 }
177 hostgroup.AggregatePerms(); 177 hostgroup.InvalidateEffectivePerms();
178 } 178 }
179 179
180 hostgroup.RootPart.ObjectSaleType = 0; 180 hostgroup.RootPart.ObjectSaleType = 0;
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
index d52a1d5..65d50bb 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
@@ -901,7 +901,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
901 remoteClient.SendCreateGroupReply(groupID, true, "Group created successfully"); 901 remoteClient.SendCreateGroupReply(groupID, true, "Group created successfully");
902 902
903 // Update the founder with new group information. 903 // Update the founder with new group information.
904 SendAgentGroupDataUpdate(remoteClient, false); 904 SendAgentGroupDataUpdate(remoteClient, true);
905 905
906 return groupID; 906 return groupID;
907 } 907 }
@@ -1520,6 +1520,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
1520 lastname, activeGroupPowers, activeGroupName, 1520 lastname, activeGroupPowers, activeGroupName,
1521 activeGroupTitle); 1521 activeGroupTitle);
1522 1522
1523
1523 if (tellOthers) 1524 if (tellOthers)
1524 SendScenePresenceUpdate(agentID, activeGroupTitle); 1525 SendScenePresenceUpdate(agentID, activeGroupTitle);
1525 1526
diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs
index 6cf0092..fe8d962 100644
--- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs
@@ -665,7 +665,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
665 taskItem.AssetID = asset.FullID; 665 taskItem.AssetID = asset.FullID;
666 666
667 host.Inventory.AddInventoryItem(taskItem, false); 667 host.Inventory.AddInventoryItem(taskItem, false);
668 host.ParentGroup.AggregatePerms(); 668 host.ParentGroup.InvalidateEffectivePerms();
669 m_comms.DispatchReply(scriptID,1,assetID.ToString(),reqID.ToString()); 669 m_comms.DispatchReply(scriptID,1,assetID.ToString(),reqID.ToString());
670 } 670 }
671 671
diff --git a/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs b/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs
index b26fa32..da8c9a3 100644
--- a/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs
+++ b/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs
@@ -525,7 +525,7 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator
525 525
526 sceneObject.SetGroup(groupID, null); 526 sceneObject.SetGroup(groupID, null);
527 m_scene.AddNewSceneObject(sceneObject, true); 527 m_scene.AddNewSceneObject(sceneObject, true);
528 sceneObject.AggregatePerms(); 528 sceneObject.InvalidateEffectivePerms();
529 return sceneObject; 529 return sceneObject;
530 } 530 }
531 531
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index e12cedf..e51a078 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -2048,7 +2048,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2048 m_host.Inventory.AddInventoryItemExclusive(taskItem, false); 2048 m_host.Inventory.AddInventoryItemExclusive(taskItem, false);
2049 else 2049 else
2050 m_host.Inventory.AddInventoryItem(taskItem, false); 2050 m_host.Inventory.AddInventoryItem(taskItem, false);
2051 m_host.ParentGroup.AggregatePerms(); 2051 m_host.ParentGroup.InvalidateDeepEffectivePerms();
2052 2052
2053 return taskItem; 2053 return taskItem;
2054 } 2054 }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs
index 4dc8fc6..241a24d 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs
@@ -87,17 +87,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
87 uint port = 9999; 87 uint port = 9999;
88 MainServer.RemoveHttpServer(port); 88 MainServer.RemoveHttpServer(port);
89 89
90 m_engine = new MockScriptEngine();
91 m_urlModule = new UrlModule();
92
93 IConfigSource config = new IniConfigSource();
94 config.AddConfig("Network");
95 config.Configs["Network"].Set("ExternalHostNameForLSL", "127.0.0.1");
96 m_scene = new SceneHelpers().SetupScene();
97
90 BaseHttpServer server = new BaseHttpServer(port, false, 0, ""); 98 BaseHttpServer server = new BaseHttpServer(port, false, 0, "");
91 MainServer.AddHttpServer(server); 99 MainServer.AddHttpServer(server);
92 MainServer.Instance = server; 100 MainServer.Instance = server;
93 101
94 server.Start(); 102 server.Start();
95 103
96 m_engine = new MockScriptEngine(); 104 SceneHelpers.SetupSceneModules(m_scene, config, m_engine, m_urlModule);
97 m_urlModule = new UrlModule();
98
99 m_scene = new SceneHelpers().SetupScene();
100 SceneHelpers.SetupSceneModules(m_scene, new IniConfigSource(), m_engine, m_urlModule);
101 105
102 SceneObjectGroup so = SceneHelpers.AddSceneObject(m_scene); 106 SceneObjectGroup so = SceneHelpers.AddSceneObject(m_scene);
103 m_scriptItem = TaskInventoryHelpers.AddScript(m_scene.AssetService, so.RootPart); 107 m_scriptItem = TaskInventoryHelpers.AddScript(m_scene.AssetService, so.RootPart);
diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs
index fbd7e90..7902fb1 100644
--- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs
+++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs
@@ -626,6 +626,7 @@ namespace OpenSim.Tests.Common
626 //part.ObjectFlags |= (uint)PrimFlags.Phantom; 626 //part.ObjectFlags |= (uint)PrimFlags.Phantom;
627 627
628 scene.AddNewSceneObject(so, true); 628 scene.AddNewSceneObject(so, true);
629 so.InvalidateDeepEffectivePerms();
629 630
630 return so; 631 return so;
631 } 632 }
@@ -652,6 +653,7 @@ namespace OpenSim.Tests.Common
652 SceneObjectGroup so = CreateSceneObject(parts, ownerId, partNamePrefix, uuidTail); 653 SceneObjectGroup so = CreateSceneObject(parts, ownerId, partNamePrefix, uuidTail);
653 654
654 scene.AddNewSceneObject(so, false); 655 scene.AddNewSceneObject(so, false);
656 so.InvalidateDeepEffectivePerms();
655 657
656 return so; 658 return so;
657 } 659 }