aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/ILandObject.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandObject.cs41
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs34
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Permissions.cs17
4 files changed, 6 insertions, 88 deletions
diff --git a/OpenSim/Framework/ILandObject.cs b/OpenSim/Framework/ILandObject.cs
index 33aad9b..dd73b3f 100644
--- a/OpenSim/Framework/ILandObject.cs
+++ b/OpenSim/Framework/ILandObject.cs
@@ -63,7 +63,6 @@ namespace OpenSim.Framework
63 bool ContainsPoint(int x, int y); 63 bool ContainsPoint(int x, int y);
64 64
65 ILandObject Copy(); 65 ILandObject Copy();
66 ILandObject MemberwiseCopy();
67 66
68 void SendLandUpdateToAvatarsOverMe(); 67 void SendLandUpdateToAvatarsOverMe();
69 68
@@ -71,7 +70,6 @@ namespace OpenSim.Framework
71 void UpdateLandProperties(LandUpdateArgs args, IClientAPI remote_client); 70 void UpdateLandProperties(LandUpdateArgs args, IClientAPI remote_client);
72 bool IsEitherBannedOrRestricted(UUID avatar); 71 bool IsEitherBannedOrRestricted(UUID avatar);
73 bool IsBannedFromLand(UUID avatar); 72 bool IsBannedFromLand(UUID avatar);
74 bool IsAllowedInLand(UUID avatar);
75 bool IsRestrictedFromLand(UUID avatar); 73 bool IsRestrictedFromLand(UUID avatar);
76 void SendLandUpdateToClient(IClientAPI remote_client); 74 void SendLandUpdateToClient(IClientAPI remote_client);
77 void SendLandUpdateToClient(bool snap_selection, IClientAPI remote_client); 75 void SendLandUpdateToClient(bool snap_selection, IClientAPI remote_client);
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
index 640a024..cc42f7f 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
@@ -169,11 +169,6 @@ namespace OpenSim.Region.CoreModules.World.Land
169 return newLand; 169 return newLand;
170 } 170 }
171 171
172 public ILandObject MemberwiseCopy()
173 {
174 return (ILandObject)this.MemberwiseClone();
175 }
176
177 static overrideParcelMaxPrimCountDelegate overrideParcelMaxPrimCount; 172 static overrideParcelMaxPrimCountDelegate overrideParcelMaxPrimCount;
178 static overrideSimulatorMaxPrimCountDelegate overrideSimulatorMaxPrimCount; 173 static overrideSimulatorMaxPrimCountDelegate overrideSimulatorMaxPrimCount;
179 174
@@ -247,13 +242,11 @@ namespace OpenSim.Region.CoreModules.World.Land
247 m_lastSeqId = seq_id; 242 m_lastSeqId = seq_id;
248 } 243 }
249 244
250 ILandObject landToSend = this;
251 m_scene.Permissions.LandObjectForClient(remote_client.AgentId, (ILandObject)this, out landToSend);
252 remote_client.SendLandProperties(seq_id, 245 remote_client.SendLandProperties(seq_id,
253 snap_selection, request_result, landToSend, 246 snap_selection, request_result, this,
254 (float)m_scene.RegionInfo.RegionSettings.ObjectBonus, 247 (float)m_scene.RegionInfo.RegionSettings.ObjectBonus,
255 GetParcelMaxPrimCount(), 248 GetParcelMaxPrimCount(),
256 GetSimulatorMaxPrimCount(), regionFlags); 249 GetSimulatorMaxPrimCount(), regionFlags);
257 } 250 }
258 251
259 public void UpdateLandProperties(LandUpdateArgs args, IClientAPI remote_client) 252 public void UpdateLandProperties(LandUpdateArgs args, IClientAPI remote_client)
@@ -482,32 +475,6 @@ namespace OpenSim.Region.CoreModules.World.Land
482 return false; 475 return false;
483 } 476 }
484 477
485 public bool IsAllowedInLand(UUID avatar)
486 {
487 ExpireAccessList();
488
489 if (m_scene.Permissions.IsAdministrator(avatar))
490 return true;
491
492 if (m_scene.RegionInfo.EstateSettings.IsEstateManager(avatar))
493 return true;
494
495 if (avatar == LandData.OwnerID)
496 return true;
497
498 if (LandData.ParcelAccessList.FindIndex(
499 delegate(LandAccessEntry e)
500 {
501 if (e.AgentID == avatar && e.Flags == AccessList.Access)
502 return true;
503 return false;
504 }) != -1)
505 {
506 return true;
507 }
508 return false;
509 }
510
511 public void SendLandUpdateToClient(IClientAPI remote_client) 478 public void SendLandUpdateToClient(IClientAPI remote_client)
512 { 479 {
513 SendLandProperties(0, false, 0, remote_client); 480 SendLandProperties(0, false, 0, remote_client);
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index f536a0f..6018c39 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -94,9 +94,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
94 private bool m_RegionOwnerIsGod = false; 94 private bool m_RegionOwnerIsGod = false;
95 private bool m_RegionManagerIsGod = false; 95 private bool m_RegionManagerIsGod = false;
96 private bool m_ParcelOwnerIsGod = false; 96 private bool m_ParcelOwnerIsGod = false;
97 97
98 private bool m_SimpleBuildPermissions = false;
99
100 /// <value> 98 /// <value>
101 /// The set of users that are allowed to create scripts. This is only active if permissions are not being 99 /// The set of users that are allowed to create scripts. This is only active if permissions are not being
102 /// bypassed. This overrides normal permissions. 100 /// bypassed. This overrides normal permissions.
@@ -141,9 +139,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
141 m_RegionOwnerIsGod = myConfig.GetBoolean("region_owner_is_god", true); 139 m_RegionOwnerIsGod = myConfig.GetBoolean("region_owner_is_god", true);
142 m_RegionManagerIsGod = myConfig.GetBoolean("region_manager_is_god", false); 140 m_RegionManagerIsGod = myConfig.GetBoolean("region_manager_is_god", false);
143 m_ParcelOwnerIsGod = myConfig.GetBoolean("parcel_owner_is_god", true); 141 m_ParcelOwnerIsGod = myConfig.GetBoolean("parcel_owner_is_god", true);
144 142
145 m_SimpleBuildPermissions = myConfig.GetBoolean("simple_build_permissions", false);
146
147 m_allowedScriptCreators 143 m_allowedScriptCreators
148 = ParseUserSetConfigSetting(myConfig, "allowed_script_creators", m_allowedScriptCreators); 144 = ParseUserSetConfigSetting(myConfig, "allowed_script_creators", m_allowedScriptCreators);
149 m_allowedScriptEditors 145 m_allowedScriptEditors
@@ -210,9 +206,6 @@ namespace OpenSim.Region.CoreModules.World.Permissions
210 m_scene.Permissions.OnControlPrimMedia += CanControlPrimMedia; 206 m_scene.Permissions.OnControlPrimMedia += CanControlPrimMedia;
211 m_scene.Permissions.OnInteractWithPrimMedia += CanInteractWithPrimMedia; 207 m_scene.Permissions.OnInteractWithPrimMedia += CanInteractWithPrimMedia;
212 208
213 if (m_SimpleBuildPermissions)
214 m_scene.Permissions.OnSendLandProperties += GenerateLandProperties;
215
216 m_scene.AddCommand("Users", this, "bypass permissions", 209 m_scene.AddCommand("Users", this, "bypass permissions",
217 "bypass permissions <true / false>", 210 "bypass permissions <true / false>",
218 "Bypass permission checks", 211 "Bypass permission checks",
@@ -831,10 +824,6 @@ namespace OpenSim.Region.CoreModules.World.Permissions
831 permission = true; 824 permission = true;
832 } 825 }
833 826
834 if (m_SimpleBuildPermissions &&
835 (parcel.LandData.Flags & (uint)ParcelFlags.UseAccessList) == 0 && parcel.IsAllowedInLand(user))
836 permission = true;
837
838 return permission; 827 return permission;
839 } 828 }
840 829
@@ -1977,24 +1966,5 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1977 1966
1978 return false; 1967 return false;
1979 } 1968 }
1980
1981 private void GenerateLandProperties(UUID userID, ILandObject realLand, out ILandObject landToSend)
1982 {
1983 landToSend = realLand;
1984 if (m_bypassPermissions) return;
1985
1986 if (m_SimpleBuildPermissions &&
1987 !m_scene.Permissions.IsAdministrator(userID) &&
1988 !realLand.LandData.OwnerID.Equals(userID) &&
1989 ((realLand.LandData.Flags & (uint)ParcelFlags.UseAccessList) == 0 && realLand.IsAllowedInLand(userID)))
1990 {
1991 ILandObject clone = realLand.MemberwiseCopy();
1992 LandData ldata = realLand.LandData.Copy();
1993 clone.LandData = ldata;
1994 clone.LandData.Flags |= (uint)(ParcelFlags.AllowAPrimitiveEntry | ParcelFlags.AllowFly | ParcelFlags.AllowOtherScripts | ParcelFlags.CreateObjects);
1995 landToSend = clone;
1996 }
1997 }
1998
1999 } 1969 }
2000} 1970}
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
index a4605c4..e1fedf4 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
@@ -90,7 +90,6 @@ namespace OpenSim.Region.Framework.Scenes
90 public delegate bool TeleportHandler(UUID userID, Scene scene); 90 public delegate bool TeleportHandler(UUID userID, Scene scene);
91 public delegate bool ControlPrimMediaHandler(UUID userID, UUID primID, int face); 91 public delegate bool ControlPrimMediaHandler(UUID userID, UUID primID, int face);
92 public delegate bool InteractWithPrimMediaHandler(UUID userID, UUID primID, int face); 92 public delegate bool InteractWithPrimMediaHandler(UUID userID, UUID primID, int face);
93 public delegate void SendLandPropertiesHandler(UUID userID, ILandObject realLand, out ILandObject landToSend);
94 #endregion 93 #endregion
95 94
96 public class ScenePermissions 95 public class ScenePermissions
@@ -158,7 +157,6 @@ namespace OpenSim.Region.Framework.Scenes
158 public event TeleportHandler OnTeleport; 157 public event TeleportHandler OnTeleport;
159 public event ControlPrimMediaHandler OnControlPrimMedia; 158 public event ControlPrimMediaHandler OnControlPrimMedia;
160 public event InteractWithPrimMediaHandler OnInteractWithPrimMedia; 159 public event InteractWithPrimMediaHandler OnInteractWithPrimMedia;
161 public event SendLandPropertiesHandler OnSendLandProperties;
162 #endregion 160 #endregion
163 161
164 #region Object Permission Checks 162 #region Object Permission Checks
@@ -1100,20 +1098,5 @@ namespace OpenSim.Region.Framework.Scenes
1100 } 1098 }
1101 return true; 1099 return true;
1102 } 1100 }
1103
1104 public void LandObjectForClient(UUID userID, ILandObject realLand, out ILandObject landToSend)
1105 {
1106 landToSend = realLand;
1107 SendLandPropertiesHandler handler = OnSendLandProperties;
1108 if (handler != null)
1109 {
1110 Delegate[] list = handler.GetInvocationList();
1111 foreach (SendLandPropertiesHandler h in list)
1112 {
1113 h(userID, realLand, out landToSend);
1114 }
1115 }
1116 }
1117
1118 } 1101 }
1119} 1102}