Rework Diva's patch to simplify it

0.7.4.1
Melanie 2012-03-22 20:25:20 +00:00
parent 45b588cf00
commit b5d0bc2488
3 changed files with 30 additions and 16 deletions

View File

@ -71,6 +71,7 @@ namespace OpenSim.Framework
bool IsEitherBannedOrRestricted(UUID avatar); bool IsEitherBannedOrRestricted(UUID avatar);
bool IsBannedFromLand(UUID avatar); bool IsBannedFromLand(UUID avatar);
bool IsRestrictedFromLand(UUID avatar); bool IsRestrictedFromLand(UUID avatar);
bool IsInLandAccessList(UUID avatar);
void SendLandUpdateToClient(IClientAPI remote_client); void SendLandUpdateToClient(IClientAPI remote_client);
void SendLandUpdateToClient(bool snap_selection, IClientAPI remote_client); void SendLandUpdateToClient(bool snap_selection, IClientAPI remote_client);
List<LandAccessEntry> CreateAccessListArrayByFlag(AccessList flag); List<LandAccessEntry> CreateAccessListArrayByFlag(AccessList flag);

View File

@ -448,8 +448,6 @@ namespace OpenSim.Region.CoreModules.World.Land
public bool IsRestrictedFromLand(UUID avatar) public bool IsRestrictedFromLand(UUID avatar)
{ {
ExpireAccessList();
if (m_scene.Permissions.IsAdministrator(avatar)) if (m_scene.Permissions.IsAdministrator(avatar))
return false; return false;
@ -459,8 +457,16 @@ namespace OpenSim.Region.CoreModules.World.Land
if (avatar == LandData.OwnerID) if (avatar == LandData.OwnerID)
return false; return false;
if ((LandData.Flags & (uint) ParcelFlags.UseAccessList) > 0) if ((LandData.Flags & (uint) ParcelFlags.UseAccessList) == 0)
return true;
return (!IsInLandAccessList(avatar));
}
public bool IsInLandAccessList(UUID avatar)
{ {
ExpireAccessList();
if (LandData.ParcelAccessList.FindIndex( if (LandData.ParcelAccessList.FindIndex(
delegate(LandAccessEntry e) delegate(LandAccessEntry e)
{ {
@ -469,11 +475,10 @@ namespace OpenSim.Region.CoreModules.World.Land
return false; return false;
}) == -1) }) == -1)
{ {
return true;
}
}
return false; return false;
} }
return true;
}
public void SendLandUpdateToClient(IClientAPI remote_client) public void SendLandUpdateToClient(IClientAPI remote_client)
{ {

View File

@ -95,6 +95,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions
private bool m_RegionManagerIsGod = false; private bool m_RegionManagerIsGod = false;
private bool m_ParcelOwnerIsGod = false; private bool m_ParcelOwnerIsGod = false;
private bool m_SimpleBuildPermissions = false;
/// <value> /// <value>
/// The set of users that are allowed to create scripts. This is only active if permissions are not being /// The set of users that are allowed to create scripts. This is only active if permissions are not being
/// bypassed. This overrides normal permissions. /// bypassed. This overrides normal permissions.
@ -140,6 +142,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions
m_RegionManagerIsGod = myConfig.GetBoolean("region_manager_is_god", false); m_RegionManagerIsGod = myConfig.GetBoolean("region_manager_is_god", false);
m_ParcelOwnerIsGod = myConfig.GetBoolean("parcel_owner_is_god", true); m_ParcelOwnerIsGod = myConfig.GetBoolean("parcel_owner_is_god", true);
m_SimpleBuildPermissions = myConfig.GetBoolean("simple_build_permissions", false);
m_allowedScriptCreators m_allowedScriptCreators
= ParseUserSetConfigSetting(myConfig, "allowed_script_creators", m_allowedScriptCreators); = ParseUserSetConfigSetting(myConfig, "allowed_script_creators", m_allowedScriptCreators);
m_allowedScriptEditors m_allowedScriptEditors
@ -824,6 +828,10 @@ namespace OpenSim.Region.CoreModules.World.Permissions
permission = true; permission = true;
} }
if (m_SimpleBuildPermissions &&
(parcel.LandData.Flags & (uint)ParcelFlags.UseAccessList) == 0 && parcel.IsInLandAccessList(user))
permission = true;
return permission; return permission;
} }