aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorUbitUmarov2017-04-03 16:10:05 +0100
committerUbitUmarov2017-04-03 16:10:05 +0100
commiteb11505d19be8c2b22776d927ac5b836bd5493c3 (patch)
tree03da3c94975e7be7ba6760e64d7687afd565d53e /OpenSim/Region/CoreModules
parent store the physics inertia override in SQlite (diff)
downloadopensim-SC_OLD-eb11505d19be8c2b22776d927ac5b836bd5493c3.zip
opensim-SC_OLD-eb11505d19be8c2b22776d927ac5b836bd5493c3.tar.gz
opensim-SC_OLD-eb11505d19be8c2b22776d927ac5b836bd5493c3.tar.bz2
opensim-SC_OLD-eb11505d19be8c2b22776d927ac5b836bd5493c3.tar.xz
add bool CanObjectEnterWithScripts(SceneObjectGroup sog, ILandObject land) permissions check
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs52
1 files changed, 52 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index ab8fb51..8eee864 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -286,6 +286,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
286 286
287 scenePermissions.OnRezObject += CanRezObject; 287 scenePermissions.OnRezObject += CanRezObject;
288 scenePermissions.OnObjectEntry += CanObjectEntry; 288 scenePermissions.OnObjectEntry += CanObjectEntry;
289 scenePermissions.OnObjectEnterWithScripts += OnObjectEnterWithScripts;
289 290
290 scenePermissions.OnDuplicateObject += CanDuplicateObject; 291 scenePermissions.OnDuplicateObject += CanDuplicateObject;
291 scenePermissions.OnDeleteObjectByIDs += CanDeleteObjectByIDs; 292 scenePermissions.OnDeleteObjectByIDs += CanDeleteObjectByIDs;
@@ -381,6 +382,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions
381 382
382 scenePermissions.OnRezObject -= CanRezObject; 383 scenePermissions.OnRezObject -= CanRezObject;
383 scenePermissions.OnObjectEntry -= CanObjectEntry; 384 scenePermissions.OnObjectEntry -= CanObjectEntry;
385 scenePermissions.OnObjectEnterWithScripts -= OnObjectEnterWithScripts;
386
384 scenePermissions.OnReturnObjects -= CanReturnObjects; 387 scenePermissions.OnReturnObjects -= CanReturnObjects;
385 388
386 scenePermissions.OnDuplicateObject -= CanDuplicateObject; 389 scenePermissions.OnDuplicateObject -= CanDuplicateObject;
@@ -1627,6 +1630,55 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1627 return false; 1630 return false;
1628 } 1631 }
1629 1632
1633 private bool OnObjectEnterWithScripts(SceneObjectGroup sog, ILandObject parcel)
1634 {
1635 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
1636
1637 if(sog == null || sog.IsDeleted)
1638 return false;
1639
1640 if (m_bypassPermissions)
1641 return m_bypassPermissionsValue;
1642
1643 if (parcel == null)
1644 return true;
1645
1646 int checkflags = ((int)ParcelFlags.AllowAPrimitiveEntry);
1647 bool scripts = (sog.ScriptCount() > 0);
1648 if(scripts)
1649 checkflags |= ((int)ParcelFlags.AllowOtherScripts);
1650
1651 if ((parcel.LandData.Flags & checkflags) == checkflags)
1652 return true;
1653
1654 UUID userID = sog.OwnerID;
1655 LandData landdata = parcel.LandData;
1656
1657 if (landdata.OwnerID == userID)
1658 return true;
1659
1660 if (IsAdministrator(userID))
1661 return true;
1662
1663 UUID landGroupID = landdata.GroupID;
1664 if (landGroupID != UUID.Zero)
1665 {
1666 checkflags = (int)ParcelFlags.AllowGroupObjectEntry;
1667 if(scripts)
1668 checkflags |= ((int)ParcelFlags.AllowGroupScripts);
1669
1670 if ((parcel.LandData.Flags & checkflags) == checkflags)
1671 return IsGroupMember(landGroupID, userID, 0);
1672
1673 if (landdata.IsGroupOwned && IsGroupMember(landGroupID, userID, (ulong)GroupPowers.AllowRez))
1674 return true;
1675 }
1676
1677 //Otherwise, false!
1678 return false;
1679 }
1680
1681
1630 private bool CanReturnObjects(ILandObject land, ScenePresence sp, List<SceneObjectGroup> objects) 1682 private bool CanReturnObjects(ILandObject land, ScenePresence sp, List<SceneObjectGroup> objects)
1631 { 1683 {
1632 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 1684 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);