diff options
author | Melanie | 2012-03-22 20:25:20 +0000 |
---|---|---|
committer | Melanie | 2012-03-22 20:25:20 +0000 |
commit | b5d0bc24887e177e7b6e982789bfd86f27b84cf0 (patch) | |
tree | 210b3919d840588405d2d856f1ae8b348f0e6b73 | |
parent | Revert "Simple build permissions feature. NOTE: EXPERIMENTAL, DISABLED BY DEF... (diff) | |
download | opensim-SC-b5d0bc24887e177e7b6e982789bfd86f27b84cf0.zip opensim-SC-b5d0bc24887e177e7b6e982789bfd86f27b84cf0.tar.gz opensim-SC-b5d0bc24887e177e7b6e982789bfd86f27b84cf0.tar.bz2 opensim-SC-b5d0bc24887e177e7b6e982789bfd86f27b84cf0.tar.xz |
Rework Diva's patch to simplify it
-rw-r--r-- | OpenSim/Framework/ILandObject.cs | 1 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandObject.cs | 33 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | 12 |
3 files changed, 30 insertions, 16 deletions
diff --git a/OpenSim/Framework/ILandObject.cs b/OpenSim/Framework/ILandObject.cs index dd73b3f..4f98d7b 100644 --- a/OpenSim/Framework/ILandObject.cs +++ b/OpenSim/Framework/ILandObject.cs | |||
@@ -71,6 +71,7 @@ namespace OpenSim.Framework | |||
71 | bool IsEitherBannedOrRestricted(UUID avatar); | 71 | bool IsEitherBannedOrRestricted(UUID avatar); |
72 | bool IsBannedFromLand(UUID avatar); | 72 | bool IsBannedFromLand(UUID avatar); |
73 | bool IsRestrictedFromLand(UUID avatar); | 73 | bool IsRestrictedFromLand(UUID avatar); |
74 | bool IsInLandAccessList(UUID avatar); | ||
74 | void SendLandUpdateToClient(IClientAPI remote_client); | 75 | void SendLandUpdateToClient(IClientAPI remote_client); |
75 | void SendLandUpdateToClient(bool snap_selection, IClientAPI remote_client); | 76 | void SendLandUpdateToClient(bool snap_selection, IClientAPI remote_client); |
76 | List<LandAccessEntry> CreateAccessListArrayByFlag(AccessList flag); | 77 | List<LandAccessEntry> CreateAccessListArrayByFlag(AccessList flag); |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index cc42f7f..27f0052 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs | |||
@@ -448,8 +448,6 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
448 | 448 | ||
449 | public bool IsRestrictedFromLand(UUID avatar) | 449 | public bool IsRestrictedFromLand(UUID avatar) |
450 | { | 450 | { |
451 | ExpireAccessList(); | ||
452 | |||
453 | if (m_scene.Permissions.IsAdministrator(avatar)) | 451 | if (m_scene.Permissions.IsAdministrator(avatar)) |
454 | return false; | 452 | return false; |
455 | 453 | ||
@@ -459,20 +457,27 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
459 | if (avatar == LandData.OwnerID) | 457 | if (avatar == LandData.OwnerID) |
460 | return false; | 458 | return false; |
461 | 459 | ||
462 | if ((LandData.Flags & (uint) ParcelFlags.UseAccessList) > 0) | 460 | if ((LandData.Flags & (uint) ParcelFlags.UseAccessList) == 0) |
461 | return true; | ||
462 | |||
463 | return (!IsInLandAccessList(avatar)); | ||
464 | } | ||
465 | |||
466 | public bool IsInLandAccessList(UUID avatar) | ||
467 | { | ||
468 | ExpireAccessList(); | ||
469 | |||
470 | if (LandData.ParcelAccessList.FindIndex( | ||
471 | delegate(LandAccessEntry e) | ||
472 | { | ||
473 | if (e.AgentID == avatar && e.Flags == AccessList.Access) | ||
474 | return true; | ||
475 | return false; | ||
476 | }) == -1) | ||
463 | { | 477 | { |
464 | if (LandData.ParcelAccessList.FindIndex( | 478 | return false; |
465 | delegate(LandAccessEntry e) | ||
466 | { | ||
467 | if (e.AgentID == avatar && e.Flags == AccessList.Access) | ||
468 | return true; | ||
469 | return false; | ||
470 | }) == -1) | ||
471 | { | ||
472 | return true; | ||
473 | } | ||
474 | } | 479 | } |
475 | return false; | 480 | return true; |
476 | } | 481 | } |
477 | 482 | ||
478 | public void SendLandUpdateToClient(IClientAPI remote_client) | 483 | public void SendLandUpdateToClient(IClientAPI remote_client) |
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 6018c39..ac03747 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |||
@@ -94,7 +94,9 @@ 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 | |||
98 | /// <value> | 100 | /// <value> |
99 | /// The set of users that are allowed to create scripts. This is only active if permissions are not being | 101 | /// The set of users that are allowed to create scripts. This is only active if permissions are not being |
100 | /// bypassed. This overrides normal permissions. | 102 | /// bypassed. This overrides normal permissions. |
@@ -139,7 +141,9 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
139 | m_RegionOwnerIsGod = myConfig.GetBoolean("region_owner_is_god", true); | 141 | m_RegionOwnerIsGod = myConfig.GetBoolean("region_owner_is_god", true); |
140 | m_RegionManagerIsGod = myConfig.GetBoolean("region_manager_is_god", false); | 142 | m_RegionManagerIsGod = myConfig.GetBoolean("region_manager_is_god", false); |
141 | m_ParcelOwnerIsGod = myConfig.GetBoolean("parcel_owner_is_god", true); | 143 | m_ParcelOwnerIsGod = myConfig.GetBoolean("parcel_owner_is_god", true); |
142 | 144 | ||
145 | m_SimpleBuildPermissions = myConfig.GetBoolean("simple_build_permissions", false); | ||
146 | |||
143 | m_allowedScriptCreators | 147 | m_allowedScriptCreators |
144 | = ParseUserSetConfigSetting(myConfig, "allowed_script_creators", m_allowedScriptCreators); | 148 | = ParseUserSetConfigSetting(myConfig, "allowed_script_creators", m_allowedScriptCreators); |
145 | m_allowedScriptEditors | 149 | m_allowedScriptEditors |
@@ -824,6 +828,10 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
824 | permission = true; | 828 | permission = true; |
825 | } | 829 | } |
826 | 830 | ||
831 | if (m_SimpleBuildPermissions && | ||
832 | (parcel.LandData.Flags & (uint)ParcelFlags.UseAccessList) == 0 && parcel.IsInLandAccessList(user)) | ||
833 | permission = true; | ||
834 | |||
827 | return permission; | 835 | return permission; |
828 | } | 836 | } |
829 | 837 | ||