Differentiate between requests only the owner should be able to do and those

that managers can do when setting parcel data
avinationmerge
Melanie Thielker 2014-04-26 20:32:27 +02:00
parent 1d1e444aed
commit d97896d39a
7 changed files with 29 additions and 29 deletions

View File

@ -565,7 +565,7 @@ namespace OpenSim.Region.CoreModules.World.Land
requiredPowers = GroupPowers.LandManageBanned; requiredPowers = GroupPowers.LandManageBanned;
if (m_scene.Permissions.CanEditParcelProperties(agentID, if (m_scene.Permissions.CanEditParcelProperties(agentID,
land, requiredPowers)) land, requiredPowers, false))
{ {
land.UpdateAccessList(flags, transactionID, sequenceID, land.UpdateAccessList(flags, transactionID, sequenceID,
sections, entries, remote_client); sections, entries, remote_client);
@ -927,7 +927,7 @@ namespace OpenSim.Region.CoreModules.World.Land
//If we are still here, then they are subdividing within one piece of land //If we are still here, then they are subdividing within one piece of land
//Check owner //Check owner
if (!m_scene.Permissions.CanEditParcelProperties(attempting_user_id, startLandObject, GroupPowers.LandDivideJoin)) if (!m_scene.Permissions.CanEditParcelProperties(attempting_user_id, startLandObject, GroupPowers.LandDivideJoin, true))
{ {
return; return;
} }
@ -996,7 +996,7 @@ namespace OpenSim.Region.CoreModules.World.Land
{ {
return; return;
} }
if (!m_scene.Permissions.CanEditParcelProperties(attempting_user_id, masterLandObject, GroupPowers.LandDivideJoin)) if (!m_scene.Permissions.CanEditParcelProperties(attempting_user_id, masterLandObject, GroupPowers.LandDivideJoin, true))
{ {
return; return;
} }
@ -1727,7 +1727,7 @@ namespace OpenSim.Region.CoreModules.World.Land
if (land == null) return; if (land == null) return;
if (!m_scene.Permissions.CanEditParcelProperties(remoteClient.AgentId, land, GroupPowers.LandOptions)) if (!m_scene.Permissions.CanEditParcelProperties(remoteClient.AgentId, land, GroupPowers.LandOptions, false))
return; return;
land.LandData.OtherCleanTime = otherCleanTime; land.LandData.OtherCleanTime = otherCleanTime;
@ -1827,7 +1827,7 @@ namespace OpenSim.Region.CoreModules.World.Land
if (targetAvatar.UserLevel == 0) if (targetAvatar.UserLevel == 0)
{ {
ILandObject land = ((Scene)client.Scene).LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y); ILandObject land = ((Scene)client.Scene).LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y);
if (!((Scene)client.Scene).Permissions.CanEditParcelProperties(client.AgentId, land, GroupPowers.LandEjectAndFreeze)) if (!((Scene)client.Scene).Permissions.CanEditParcelProperties(client.AgentId, land, GroupPowers.LandEjectAndFreeze, true))
return; return;
if (flags == 0) if (flags == 0)
{ {
@ -1876,7 +1876,7 @@ namespace OpenSim.Region.CoreModules.World.Land
// Check if you even have permission to do this // Check if you even have permission to do this
ILandObject land = m_scene.LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y); ILandObject land = m_scene.LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y);
if (!m_scene.Permissions.CanEditParcelProperties(client.AgentId, land, GroupPowers.LandEjectAndFreeze) && if (!m_scene.Permissions.CanEditParcelProperties(client.AgentId, land, GroupPowers.LandEjectAndFreeze, true) &&
!m_scene.Permissions.IsAdministrator(client.AgentId)) !m_scene.Permissions.IsAdministrator(client.AgentId))
return; return;

View File

@ -286,7 +286,7 @@ namespace OpenSim.Region.CoreModules.World.Land
// ParcelFlags.ForSaleObjects // ParcelFlags.ForSaleObjects
// ParcelFlags.LindenHome // ParcelFlags.LindenHome
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandOptions)) if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandOptions, false))
{ {
allowedDelta |= (uint)(ParcelFlags.AllowLandmark | allowedDelta |= (uint)(ParcelFlags.AllowLandmark |
ParcelFlags.AllowTerraform | ParcelFlags.AllowTerraform |
@ -301,7 +301,7 @@ namespace OpenSim.Region.CoreModules.World.Land
ParcelFlags.AllowFly); ParcelFlags.AllowFly);
} }
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandSetSale)) if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandSetSale, true))
{ {
if (args.AuthBuyerID != newData.AuthBuyerID || if (args.AuthBuyerID != newData.AuthBuyerID ||
args.SalePrice != newData.SalePrice) args.SalePrice != newData.SalePrice)
@ -324,7 +324,7 @@ namespace OpenSim.Region.CoreModules.World.Land
allowedDelta |= (uint)ParcelFlags.ForSale; allowedDelta |= (uint)ParcelFlags.ForSale;
} }
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.FindPlaces)) if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.FindPlaces, false))
{ {
newData.Category = args.Category; newData.Category = args.Category;
@ -333,21 +333,21 @@ namespace OpenSim.Region.CoreModules.World.Land
ParcelFlags.MaturePublish) | (uint)(1 << 23); ParcelFlags.MaturePublish) | (uint)(1 << 23);
} }
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.LandChangeIdentity)) if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.LandChangeIdentity, false))
{ {
newData.Description = args.Desc; newData.Description = args.Desc;
newData.Name = args.Name; newData.Name = args.Name;
newData.SnapshotID = args.SnapshotID; newData.SnapshotID = args.SnapshotID;
} }
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.SetLandingPoint)) if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.SetLandingPoint, false))
{ {
newData.LandingType = args.LandingType; newData.LandingType = args.LandingType;
newData.UserLocation = args.UserLocation; newData.UserLocation = args.UserLocation;
newData.UserLookAt = args.UserLookAt; newData.UserLookAt = args.UserLookAt;
} }
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.ChangeMedia)) if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.ChangeMedia, false))
{ {
newData.MediaAutoScale = args.MediaAutoScale; newData.MediaAutoScale = args.MediaAutoScale;
newData.MediaID = args.MediaID; newData.MediaID = args.MediaID;
@ -368,7 +368,7 @@ namespace OpenSim.Region.CoreModules.World.Land
ParcelFlags.UseEstateVoiceChan); ParcelFlags.UseEstateVoiceChan);
} }
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.LandManagePasses)) if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.LandManagePasses, false))
{ {
newData.PassHours = args.PassHours; newData.PassHours = args.PassHours;
newData.PassPrice = args.PassPrice; newData.PassPrice = args.PassPrice;
@ -376,13 +376,13 @@ namespace OpenSim.Region.CoreModules.World.Land
allowedDelta |= (uint)ParcelFlags.UsePassList; allowedDelta |= (uint)ParcelFlags.UsePassList;
} }
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandManageAllowed)) if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandManageAllowed, false))
{ {
allowedDelta |= (uint)(ParcelFlags.UseAccessGroup | allowedDelta |= (uint)(ParcelFlags.UseAccessGroup |
ParcelFlags.UseAccessList); ParcelFlags.UseAccessList);
} }
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandManageBanned)) if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandManageBanned, false))
{ {
allowedDelta |= (uint)(ParcelFlags.UseBanList | allowedDelta |= (uint)(ParcelFlags.UseBanList |
ParcelFlags.DenyAnonymous | ParcelFlags.DenyAnonymous |
@ -952,7 +952,7 @@ namespace OpenSim.Region.CoreModules.World.Land
public void SendForceObjectSelect(int local_id, int request_type, List<UUID> returnIDs, IClientAPI remote_client) public void SendForceObjectSelect(int local_id, int request_type, List<UUID> returnIDs, IClientAPI remote_client)
{ {
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandOptions)) if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandOptions, true))
{ {
List<uint> resultLocalIDs = new List<uint>(); List<uint> resultLocalIDs = new List<uint>();
try try
@ -1002,7 +1002,7 @@ namespace OpenSim.Region.CoreModules.World.Land
/// </param> /// </param>
public void SendLandObjectOwners(IClientAPI remote_client) public void SendLandObjectOwners(IClientAPI remote_client)
{ {
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandOptions)) if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandOptions, true))
{ {
Dictionary<UUID, int> primCount = new Dictionary<UUID, int>(); Dictionary<UUID, int> primCount = new Dictionary<UUID, int>();
List<UUID> groups = new List<UUID>(); List<UUID> groups = new List<UUID>();

View File

@ -1047,7 +1047,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
return GenericObjectPermission(editorID, objectID, false); return GenericObjectPermission(editorID, objectID, false);
} }
private bool CanEditParcelProperties(UUID user, ILandObject parcel, GroupPowers p, Scene scene) private bool CanEditParcelProperties(UUID user, ILandObject parcel, GroupPowers p, Scene scene, bool allowManager)
{ {
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions) return m_bypassPermissionsValue; if (m_bypassPermissions) return m_bypassPermissionsValue;

View File

@ -70,7 +70,7 @@ namespace OpenSim.Region.Framework.Scenes
public delegate bool IsGridGodHandler(UUID user, Scene requestFromScene); public delegate bool IsGridGodHandler(UUID user, Scene requestFromScene);
public delegate bool IsAdministratorHandler(UUID user); public delegate bool IsAdministratorHandler(UUID user);
public delegate bool EditParcelHandler(UUID user, ILandObject parcel, Scene scene); public delegate bool EditParcelHandler(UUID user, ILandObject parcel, Scene scene);
public delegate bool EditParcelPropertiesHandler(UUID user, ILandObject parcel, GroupPowers p, Scene scene); public delegate bool EditParcelPropertiesHandler(UUID user, ILandObject parcel, GroupPowers p, Scene scene, bool allowManager);
public delegate bool SellParcelHandler(UUID user, ILandObject parcel, Scene scene); public delegate bool SellParcelHandler(UUID user, ILandObject parcel, Scene scene);
public delegate bool AbandonParcelHandler(UUID user, ILandObject parcel, Scene scene); public delegate bool AbandonParcelHandler(UUID user, ILandObject parcel, Scene scene);
public delegate bool ReclaimParcelHandler(UUID user, ILandObject parcel, Scene scene); public delegate bool ReclaimParcelHandler(UUID user, ILandObject parcel, Scene scene);
@ -763,7 +763,7 @@ namespace OpenSim.Region.Framework.Scenes
#region EDIT PARCEL #region EDIT PARCEL
public bool CanEditParcelProperties(UUID user, ILandObject parcel, GroupPowers p) public bool CanEditParcelProperties(UUID user, ILandObject parcel, GroupPowers p, bool allowManager)
{ {
EditParcelPropertiesHandler handler = OnEditParcelProperties; EditParcelPropertiesHandler handler = OnEditParcelProperties;
if (handler != null) if (handler != null)
@ -771,7 +771,7 @@ namespace OpenSim.Region.Framework.Scenes
Delegate[] list = handler.GetInvocationList(); Delegate[] list = handler.GetInvocationList();
foreach (EditParcelPropertiesHandler h in list) foreach (EditParcelPropertiesHandler h in list)
{ {
if (h(user, parcel, p, m_scene) == false) if (h(user, parcel, p, m_scene, allowManager) == false)
return false; return false;
} }
} }

View File

@ -105,9 +105,9 @@ namespace OpenSim.Region.RegionCombinerModule
return m_rootScene.Permissions.CanEditObject(objectid, editorid); return m_rootScene.Permissions.CanEditObject(objectid, editorid);
} }
public bool CanEditParcelProperties(UUID user, ILandObject parcel, GroupPowers g, Scene scene) public bool CanEditParcelProperties(UUID user, ILandObject parcel, GroupPowers g, Scene scene, bool allowManager)
{ {
return m_rootScene.Permissions.CanEditParcelProperties(user, parcel, g); return m_rootScene.Permissions.CanEditParcelProperties(user, parcel, g, allowManager);
} }
public bool CanInstantMessage(UUID user, UUID target, Scene startscene) public bool CanInstantMessage(UUID user, UUID target, Scene startscene)

View File

@ -7106,7 +7106,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
UUID key; UUID key;
ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition); ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition);
if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageBanned)) if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageBanned, false))
{ {
int expires = 0; int expires = 0;
if (hours != 0) if (hours != 0)
@ -10431,7 +10431,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// according to the docs, this command only works if script owner and land owner are the same // according to the docs, this command only works if script owner and land owner are the same
// lets add estate owners and gods, too, and use the generic permission check. // lets add estate owners and gods, too, and use the generic permission check.
ILandObject landObject = World.LandChannel.GetLandObject(m_host.AbsolutePosition); ILandObject landObject = World.LandChannel.GetLandObject(m_host.AbsolutePosition);
if (!World.Permissions.CanEditParcelProperties(m_host.OwnerID, landObject, GroupPowers.ChangeMedia)) return; if (!World.Permissions.CanEditParcelProperties(m_host.OwnerID, landObject, GroupPowers.ChangeMedia, false)) return;
bool update = false; // send a ParcelMediaUpdate (and possibly change the land's media URL)? bool update = false; // send a ParcelMediaUpdate (and possibly change the land's media URL)?
byte loop = 0; byte loop = 0;
@ -10874,7 +10874,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
UUID key; UUID key;
ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition); ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition);
if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageBanned)) if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageBanned, false))
{ {
int expires = 0; int expires = 0;
if (hours != 0) if (hours != 0)
@ -10915,7 +10915,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
UUID key; UUID key;
ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition); ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition);
if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageAllowed)) if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageAllowed, false))
{ {
if (UUID.TryParse(avatar, out key)) if (UUID.TryParse(avatar, out key))
{ {
@ -10942,7 +10942,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
UUID key; UUID key;
ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition); ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition);
if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageBanned)) if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageBanned, false))
{ {
if (UUID.TryParse(avatar, out key)) if (UUID.TryParse(avatar, out key))
{ {

View File

@ -1434,7 +1434,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return; return;
} }
if (!World.Permissions.CanEditParcelProperties(m_host.OwnerID, startLandObject, GroupPowers.LandOptions)) if (!World.Permissions.CanEditParcelProperties(m_host.OwnerID, startLandObject, GroupPowers.LandOptions, false))
{ {
OSSLShoutError("You do not have permission to modify the parcel"); OSSLShoutError("You do not have permission to modify the parcel");
return; return;