diff options
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 59da1c2..b012f5f 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |||
@@ -1612,12 +1612,40 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1612 | return IsAdministrator(user); | 1612 | return IsAdministrator(user); |
1613 | } | 1613 | } |
1614 | 1614 | ||
1615 | private bool CanRunScript(UUID script, UUID objectID, UUID user, Scene scene) | 1615 | private bool CanRunScript(TaskInventoryItem scriptitem, SceneObjectPart part) |
1616 | { | 1616 | { |
1617 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 1617 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
1618 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 1618 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
1619 | 1619 | ||
1620 | return true; | 1620 | if(scriptitem == null || part == null) |
1621 | return false; | ||
1622 | |||
1623 | SceneObjectGroup sog = part.ParentGroup; | ||
1624 | if(sog == null) | ||
1625 | return false; | ||
1626 | |||
1627 | Vector3 pos = sog.AbsolutePosition; | ||
1628 | ILandObject parcel = m_scene.LandChannel.GetLandObject(pos.X, pos.Y); | ||
1629 | if (parcel == null) | ||
1630 | return false; | ||
1631 | |||
1632 | LandData ldata = parcel.LandData; | ||
1633 | if(ldata == null) | ||
1634 | return false; | ||
1635 | |||
1636 | uint lflags = ldata.Flags; | ||
1637 | |||
1638 | if ((lflags & (uint)ParcelFlags.AllowOtherScripts) != 0) | ||
1639 | return true; | ||
1640 | |||
1641 | if ((part.OwnerID == ldata.OwnerID)) | ||
1642 | return true; | ||
1643 | |||
1644 | if (((lflags & (uint)ParcelFlags.AllowGroupScripts) != 0) | ||
1645 | && (ldata.GroupID != UUID.Zero) && (ldata.GroupID == part.GroupID)) | ||
1646 | return true; | ||
1647 | |||
1648 | return GenericEstatePermission(part.OwnerID); | ||
1621 | } | 1649 | } |
1622 | 1650 | ||
1623 | private bool CanSellParcel(UUID user, ILandObject parcel, Scene scene) | 1651 | private bool CanSellParcel(UUID user, ILandObject parcel, Scene scene) |