Rework Diva's patch to simplify it
parent
fa30ace67d
commit
321de1f263
|
@ -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);
|
||||
|
|
|
@ -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,20 +457,27 @@ 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)
|
||||
{
|
||||
if (e.AgentID == avatar && e.Flags == AccessList.Access)
|
||||
return true;
|
||||
return false;
|
||||
}) == -1)
|
||||
{
|
||||
if (LandData.ParcelAccessList.FindIndex(
|
||||
delegate(LandAccessEntry e)
|
||||
{
|
||||
if (e.AgentID == avatar && e.Flags == AccessList.Access)
|
||||
return true;
|
||||
return false;
|
||||
}) == -1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public void SendLandUpdateToClient(IClientAPI remote_client)
|
||||
|
|
|
@ -94,7 +94,9 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
|||
private bool m_RegionOwnerIsGod = false;
|
||||
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.
|
||||
|
@ -139,7 +141,9 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
|||
m_RegionOwnerIsGod = myConfig.GetBoolean("region_owner_is_god", true);
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue