diff options
author | Melanie | 2012-03-22 20:10:38 +0000 |
---|---|---|
committer | Melanie | 2012-03-22 20:10:38 +0000 |
commit | 45b588cf008c514f461bf43c168dcdc9902b7bb9 (patch) | |
tree | 4400b38f11e37fbab0cad9540f0d03ad05840bac /OpenSim/Region/CoreModules | |
parent | Simple build permissions feature. NOTE: EXPERIMENTAL, DISABLED BY DEFAULT. Tu... (diff) | |
download | opensim-SC-45b588cf008c514f461bf43c168dcdc9902b7bb9.zip opensim-SC-45b588cf008c514f461bf43c168dcdc9902b7bb9.tar.gz opensim-SC-45b588cf008c514f461bf43c168dcdc9902b7bb9.tar.bz2 opensim-SC-45b588cf008c514f461bf43c168dcdc9902b7bb9.tar.xz |
Revert "Simple build permissions feature. NOTE: EXPERIMENTAL, DISABLED BY DEFAULT. Turns out that this can't be expressed by cascading Permission modules, so I did it as per this patch."
This reverts commit 6146e7ef258b10888ad7464b72b75cca701e02c9.
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandObject.cs | 41 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | 34 |
2 files changed, 6 insertions, 69 deletions
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 | } |