Make the estate owner work. Changes permissions checks to allow the

estate owner user the ability to add and remove estate managers,
and have EM rights outside of that.
0.6.0-stable
Melanie Thielker 2008-08-14 18:08:22 +00:00
parent 35aeb9010a
commit c2f1771c63
7 changed files with 42 additions and 30 deletions

View File

@ -312,9 +312,20 @@ namespace OpenSim.Framework
public bool IsEstateManager(LLUUID avatarID)
{
if (IsEstateOwner(avatarID))
return true;
return l_EstateManagers.Contains(avatarID);
}
public bool IsEstateOwner(LLUUID avatarID)
{
if (avatarID == m_EstateOwner)
return true;
return false;
}
public bool IsBanned(LLUUID avatarID)
{
foreach (EstateBan ban in l_EstateBans)

View File

@ -5465,14 +5465,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
switch (Helpers.FieldToUTF8String(messagePacket.MethodData.Method))
{
case "getinfo":
if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId))
if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId, false))
{
OnDetailedEstateDataRequest(this, messagePacket.MethodData.Invoice);
}
break;
case "setregioninfo":
if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId))
if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId, false))
{
OnSetEstateFlagsRequest(convertParamStringToBool(messagePacket.ParamList[0].Parameter), convertParamStringToBool(messagePacket.ParamList[1].Parameter),
convertParamStringToBool(messagePacket.ParamList[2].Parameter), !convertParamStringToBool(messagePacket.ParamList[3].Parameter),
@ -5485,7 +5484,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
break;
// case "texturebase":
// if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId))
// if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId, false))
// {
// foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList)
// {
@ -5500,7 +5499,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// }
// break;
case "texturedetail":
if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId))
if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId, false))
{
foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList)
{
@ -5518,7 +5517,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
break;
case "textureheights":
if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId))
if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId, false))
{
foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList)
{
@ -5539,7 +5538,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
OnCommitEstateTerrainTextureRequest(this);
break;
case "setregionterrain":
if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId))
if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId, false))
{
if (messagePacket.ParamList.Length != 9)
{
@ -5578,7 +5577,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
break;
case "restart":
if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId))
if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId, false))
{
// There's only 1 block in the estateResetSim.. and that's the number of seconds till restart.
foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList)
@ -5592,7 +5591,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
break;
case "estatechangecovenantid":
if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId))
if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId, false))
{
foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList)
{
@ -5602,7 +5601,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
break;
case "estateaccessdelta": // Estate access delta manages the banlist and allow list too.
if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId))
if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId, false))
{
int estateAccessType = Convert.ToInt16(Helpers.FieldToUTF8String(messagePacket.ParamList[1].Parameter));
OnUpdateEstateAccessDeltaRequest(this, messagePacket.MethodData.Invoice, estateAccessType, new LLUUID(Helpers.FieldToUTF8String(messagePacket.ParamList[2].Parameter)));
@ -5610,7 +5609,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
break;
case "simulatormessage":
if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId))
if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId, false))
{
LLUUID invoice = messagePacket.MethodData.Invoice;
LLUUID SenderID = new LLUUID(Helpers.FieldToUTF8String(messagePacket.ParamList[2].Parameter));
@ -5621,7 +5620,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
break;
case "instantmessage":
if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId))
if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId, false))
{
if (messagePacket.ParamList.Length < 5)
break;
@ -5634,7 +5633,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
break;
case "setregiondebug":
if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId))
if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId, false))
{
LLUUID invoice = messagePacket.MethodData.Invoice;
LLUUID SenderID = messagePacket.AgentData.AgentID;
@ -5646,7 +5645,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
break;
case "teleporthomeuser":
if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId))
if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId, false))
{
LLUUID invoice = messagePacket.MethodData.Invoice;
LLUUID SenderID = messagePacket.AgentData.AgentID;
@ -5672,7 +5671,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
break;
case "terrain":
if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId))
if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId, false))
{
handlerBakeTerrain = OnBakeTerrain;
if (handlerBakeTerrain != null)
@ -5683,7 +5682,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
break;
case "estatechangeinfo":
if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId))
if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId, false))
{
LLUUID invoice = messagePacket.MethodData.Invoice;
LLUUID SenderID = messagePacket.AgentData.AgentID;

View File

@ -218,7 +218,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
switch (estateAccessType)
{
case 64:
if (m_scene.ExternalChecks.ExternalChecksCanIssueEstateCommand(remote_client.AgentId) || m_scene.ExternalChecks.ExternalChecksBypassPermissions())
if (m_scene.ExternalChecks.ExternalChecksCanIssueEstateCommand(remote_client.AgentId, false) || m_scene.ExternalChecks.ExternalChecksBypassPermissions())
{
EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans;
@ -267,7 +267,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
}
break;
case 128:
if (m_scene.ExternalChecks.ExternalChecksCanIssueEstateCommand(remote_client.AgentId) || m_scene.ExternalChecks.ExternalChecksBypassPermissions())
if (m_scene.ExternalChecks.ExternalChecksCanIssueEstateCommand(remote_client.AgentId, false) || m_scene.ExternalChecks.ExternalChecksBypassPermissions())
{
EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans;
@ -303,9 +303,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
break;
case 256:
// This needs to be updated for SuperEstateOwnerUser.. a non existing user in the estatesettings.xml
// So make sure you really trust your region owners. because they can add other estate manaagers to your other estates
if (remote_client.AgentId == m_scene.RegionInfo.MasterAvatarAssignedUUID || m_scene.ExternalChecks.ExternalChecksBypassPermissions())
if (m_scene.ExternalChecks.ExternalChecksCanIssueEstateCommand(remote_client.AgentId, true) || m_scene.ExternalChecks.ExternalChecksBypassPermissions())
{
m_scene.RegionInfo.EstateSettings.AddEstateManager(user);
m_scene.RegionInfo.EstateSettings.Save();
@ -318,9 +316,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
break;
case 512:
// This needs to be updated for SuperEstateOwnerUser.. a non existing user in the estatesettings.xml
// So make sure you really trust your region owners. because they can add other estate manaagers to your other estates
if (remote_client.AgentId == m_scene.RegionInfo.MasterAvatarAssignedUUID || m_scene.ExternalChecks.ExternalChecksBypassPermissions())
if (m_scene.ExternalChecks.ExternalChecksCanIssueEstateCommand(remote_client.AgentId, true) || m_scene.ExternalChecks.ExternalChecksBypassPermissions())
{
m_scene.RegionInfo.EstateSettings.RemoveEstateManager(user);
m_scene.RegionInfo.EstateSettings.Save();

View File

@ -626,11 +626,17 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
return GenericCommunicationPermission(user, target);
}
private bool CanIssueEstateCommand(LLUUID user, Scene requestFromScene)
private bool CanIssueEstateCommand(LLUUID user, Scene requestFromScene, bool ownerCommand)
{
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions) return m_bypassPermissionsValue;
if (m_scene.RegionInfo.EstateSettings.IsEstateOwner(user))
return true;
if (ownerCommand)
return false;
return GenericEstatePermission(user);
}

View File

@ -761,7 +761,7 @@ namespace OpenSim.Region.Environment.Scenes
#endregion
#region CAN ISSUE ESTATE COMMAND
public delegate bool CanIssueEstateCommand(LLUUID user, Scene requestFromScene);
public delegate bool CanIssueEstateCommand(LLUUID user, Scene requestFromScene, bool ownerCommand);
private List<CanIssueEstateCommand> CanIssueEstateCommandCheckFunctions = new List<CanIssueEstateCommand>();
public void addCheckIssueEstateCommand(CanIssueEstateCommand delegateFunc)
@ -775,11 +775,11 @@ namespace OpenSim.Region.Environment.Scenes
CanIssueEstateCommandCheckFunctions.Remove(delegateFunc);
}
public bool ExternalChecksCanIssueEstateCommand(LLUUID user)
public bool ExternalChecksCanIssueEstateCommand(LLUUID user, bool ownerCommand)
{
foreach (CanIssueEstateCommand check in CanIssueEstateCommandCheckFunctions)
{
if (check(user, m_scene) == false)
if (check(user, m_scene, ownerCommand) == false)
{
return false;
}

View File

@ -282,7 +282,7 @@ namespace OpenSim.Region.ScriptEngine.Common
public int osRegionRestart(double seconds)
{
m_host.AddScriptLPS(1);
if (World.ExternalChecks.ExternalChecksCanIssueEstateCommand(m_host.OwnerID))
if (World.ExternalChecks.ExternalChecksCanIssueEstateCommand(m_host.OwnerID, false))
{
World.Restart((float)seconds);
return 1;

View File

@ -121,7 +121,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
m_host.AddScriptLPS(1);
if (World.ExternalChecks.ExternalChecksCanIssueEstateCommand(m_host.OwnerID))
if (World.ExternalChecks.ExternalChecksCanIssueEstateCommand(m_host.OwnerID, false))
{
World.Restart((float)seconds);
return 1;