aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/Permissions
diff options
context:
space:
mode:
authorUbitUmarov2017-01-27 20:21:24 +0000
committerUbitUmarov2017-01-27 20:21:24 +0000
commit0091c37ed3fd3f9ed4edf079a61f986daadca16b (patch)
tree6e5ca5cb7fa6ae6325d5222b37f39a794a48d345 /OpenSim/Region/CoreModules/World/Permissions
parentparcels must be loaded before objects, so they can be added to them (diff)
downloadopensim-SC-0091c37ed3fd3f9ed4edf079a61f986daadca16b.zip
opensim-SC-0091c37ed3fd3f9ed4edf079a61f986daadca16b.tar.gz
opensim-SC-0091c37ed3fd3f9ed4edf079a61f986daadca16b.tar.bz2
opensim-SC-0091c37ed3fd3f9ed4edf079a61f986daadca16b.tar.xz
several changes relative to objects return and parcel prim counts: avoid null refs, report correct count of returned objects, make obkects counts by ownership coerent with return rules, etc
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Permissions')
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs32
1 files changed, 17 insertions, 15 deletions
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index c00112b..279b966 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -282,9 +282,10 @@ namespace OpenSim.Region.CoreModules.World.Permissions
282 scenePermissions.OnTerraformLand += CanTerraformLand; 282 scenePermissions.OnTerraformLand += CanTerraformLand;
283 scenePermissions.OnBuyLand += CanBuyLand; 283 scenePermissions.OnBuyLand += CanBuyLand;
284 284
285 scenePermissions.OnReturnObjects += CanReturnObjects;
286
285 scenePermissions.OnRezObject += CanRezObject; 287 scenePermissions.OnRezObject += CanRezObject;
286 scenePermissions.OnObjectEntry += CanObjectEntry; 288 scenePermissions.OnObjectEntry += CanObjectEntry;
287 scenePermissions.OnReturnObjects += CanReturnObjects;
288 289
289 scenePermissions.OnDuplicateObject += CanDuplicateObject; 290 scenePermissions.OnDuplicateObject += CanDuplicateObject;
290 scenePermissions.OnDeleteObjectByIDs += CanDeleteObjectByIDs; 291 scenePermissions.OnDeleteObjectByIDs += CanDeleteObjectByIDs;
@@ -1621,19 +1622,20 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1621 return false; 1622 return false;
1622 } 1623 }
1623 1624
1624 private bool CanReturnObjects(ILandObject land, UUID user, List<SceneObjectGroup> objects) 1625 private bool CanReturnObjects(ILandObject land, ScenePresence sp, List<SceneObjectGroup> objects)
1625 { 1626 {
1626 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 1627 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
1627 if (m_bypassPermissions) return m_bypassPermissionsValue; 1628 if (m_bypassPermissions) return m_bypassPermissionsValue;
1628 1629
1629 ScenePresence sp = m_scene.GetScenePresence(user); 1630 if(sp == null)
1630 if (sp == null) 1631 return true; // assuming that in this case rights are as owner
1631 return false;
1632 1632
1633 bool isPrivUser = sp.IsGod || IsEstateManager(user); 1633 UUID userID = sp.UUID;
1634 bool isPrivUser = sp.IsGod || IsEstateManager(userID);
1634 1635
1635 IClientAPI client = sp.ControllingClient; 1636 IClientAPI client = sp.ControllingClient;
1636 GroupPowers powers; 1637
1638 ulong powers = 0;
1637 ILandObject l; 1639 ILandObject l;
1638 1640
1639 foreach (SceneObjectGroup g in new List<SceneObjectGroup>(objects)) 1641 foreach (SceneObjectGroup g in new List<SceneObjectGroup>(objects))
@@ -1644,7 +1646,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1644 continue; 1646 continue;
1645 } 1647 }
1646 1648
1647 if (isPrivUser || g.OwnerID == user) 1649 if (isPrivUser || g.OwnerID == userID)
1648 continue; 1650 continue;
1649 1651
1650 // This is a short cut for efficiency. If land is non-null, 1652 // This is a short cut for efficiency. If land is non-null,
@@ -1671,7 +1673,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1671 LandData ldata = l.LandData; 1673 LandData ldata = l.LandData;
1672 // If we own the land outright, then allow 1674 // If we own the land outright, then allow
1673 // 1675 //
1674 if (ldata.OwnerID == user) 1676 if (ldata.OwnerID == userID)
1675 continue; 1677 continue;
1676 1678
1677 // Group voodoo 1679 // Group voodoo
@@ -1679,19 +1681,19 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1679 if (ldata.IsGroupOwned) 1681 if (ldata.IsGroupOwned)
1680 { 1682 {
1681 UUID lGroupID = ldata.GroupID; 1683 UUID lGroupID = ldata.GroupID;
1682 powers = (GroupPowers)client.GetGroupPowers(lGroupID);
1683 // Not a group member, or no rights at all 1684 // Not a group member, or no rights at all
1684 // 1685 //
1685 if (powers == (GroupPowers)0) 1686 powers = client.GetGroupPowers(lGroupID);
1687 if(powers == 0)
1686 { 1688 {
1687 objects.Remove(g); 1689 objects.Remove(g);
1688 continue; 1690 continue;
1689 } 1691 }
1690 1692
1691 // Group deeded object? 1693 // Group deeded object?
1692 // 1694 //
1693 if (g.OwnerID == lGroupID && 1695 if (g.OwnerID == lGroupID &&
1694 (powers & GroupPowers.ReturnGroupOwned) == (GroupPowers)0) 1696 (powers & (ulong)GroupPowers.ReturnGroupOwned) == 0)
1695 { 1697 {
1696 objects.Remove(g); 1698 objects.Remove(g);
1697 continue; 1699 continue;
@@ -1700,13 +1702,13 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1700 // Group set object? 1702 // Group set object?
1701 // 1703 //
1702 if (g.GroupID == lGroupID && 1704 if (g.GroupID == lGroupID &&
1703 (powers & GroupPowers.ReturnGroupSet) == (GroupPowers)0) 1705 (powers & (ulong)GroupPowers.ReturnGroupSet) == 0)
1704 { 1706 {
1705 objects.Remove(g); 1707 objects.Remove(g);
1706 continue; 1708 continue;
1707 } 1709 }
1708 1710
1709 if ((powers & GroupPowers.ReturnNonGroup) == (GroupPowers)0) 1711 if ((powers & (ulong)GroupPowers.ReturnNonGroup) == 0)
1710 { 1712 {
1711 objects.Remove(g); 1713 objects.Remove(g);
1712 continue; 1714 continue;