Rework Diva's patch to simplify it

0.7.3-post-fixes
Melanie 2012-03-22 20:25:20 +00:00 committed by Diva Canto
parent fa30ace67d
commit 321de1f263
3 changed files with 30 additions and 16 deletions

View File

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

View File

@ -448,8 +448,6 @@ namespace OpenSim.Region.CoreModules.World.Land
public bool IsRestrictedFromLand(UUID avatar)
{
ExpireAccessList();
if (m_scene.Permissions.IsAdministrator(avatar))
return false;
@ -459,8 +457,16 @@ namespace OpenSim.Region.CoreModules.World.Land
if (avatar == LandData.OwnerID)
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(
delegate(LandAccessEntry e)
{
@ -469,11 +475,10 @@ namespace OpenSim.Region.CoreModules.World.Land
return false;
}) == -1)
{
return true;
}
}
return false;
}
return true;
}
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_ParcelOwnerIsGod = false;
private bool m_SimpleBuildPermissions = false;
/// <value>
/// The set of users that are allowed to create scripts. This is only active if permissions are not being
/// 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_ParcelOwnerIsGod = myConfig.GetBoolean("parcel_owner_is_god", true);
m_SimpleBuildPermissions = myConfig.GetBoolean("simple_build_permissions", false);
m_allowedScriptCreators
= ParseUserSetConfigSetting(myConfig, "allowed_script_creators", m_allowedScriptCreators);
m_allowedScriptEditors
@ -824,6 +828,10 @@ namespace OpenSim.Region.CoreModules.World.Permissions
permission = true;
}
if (m_SimpleBuildPermissions &&
(parcel.LandData.Flags & (uint)ParcelFlags.UseAccessList) == 0 && parcel.IsInLandAccessList(user))
permission = true;
return permission;
}