Fix up master avatar handling for estate owners. Introduces a new

hierarchical rights structure. MasterAvatar: Owner of the region server
(may be null), net gods (users with GodLevel 200), Estate owner
(from database). Look at Opensim.ini.example to enable net gods.
Estate owner will default to master avatar.
0.6.0-stable
Melanie Thielker 2008-08-15 13:13:39 +00:00
parent 53b0ef82b3
commit dfc553d0a4
12 changed files with 85 additions and 27 deletions

View File

@ -58,6 +58,9 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
region_id = regInfo.RegionID.ToString(); region_id = regInfo.RegionID.ToString();
region_x = regInfo.RegionLocX; region_x = regInfo.RegionLocX;
region_y = regInfo.RegionLocY; region_y = regInfo.RegionLocY;
if (regInfo.EstateSettings.EstateOwner != LLUUID.Zero)
region_owner_id = regInfo.EstateSettings.EstateOwner.ToString();
else
region_owner_id = regInfo.MasterAvatarAssignedUUID.ToString(); region_owner_id = regInfo.MasterAvatarAssignedUUID.ToString();
region_http_port = regInfo.HttpPort; region_http_port = regInfo.HttpPort;
region_server_uri = regInfo.ServerURI; region_server_uri = regInfo.ServerURI;

View File

@ -2693,6 +2693,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
//Sending Estate Settings //Sending Estate Settings
returnblock[0].Parameter = Helpers.StringToField(estateName); returnblock[0].Parameter = Helpers.StringToField(estateName);
// TODO: remove this cruft once MasterAvatar is fully deprecated
//
if(m_scene.RegionInfo.EstateSettings.EstateOwner != LLUUID.Zero)
returnblock[1].Parameter = Helpers.StringToField(m_scene.RegionInfo.EstateSettings.EstateOwner.ToString());
else
returnblock[1].Parameter = Helpers.StringToField(m_scene.RegionInfo.MasterAvatarAssignedUUID.ToString()); returnblock[1].Parameter = Helpers.StringToField(m_scene.RegionInfo.MasterAvatarAssignedUUID.ToString());
returnblock[2].Parameter = Helpers.StringToField(estateID.ToString()); returnblock[2].Parameter = Helpers.StringToField(estateID.ToString());

View File

@ -135,11 +135,14 @@ namespace OpenSim.Region.ClientStack
scene.PhysicsScene.SetTerrain(scene.Heightmap.GetFloatsSerialised()); scene.PhysicsScene.SetTerrain(scene.Heightmap.GetFloatsSerialised());
scene.PhysicsScene.SetWaterLevel((float)regionInfo.RegionSettings.WaterHeight); scene.PhysicsScene.SetWaterLevel((float)regionInfo.RegionSettings.WaterHeight);
// TODO: Remove this cruft once MasterAvatar is fully deprecated
//Master Avatar Setup //Master Avatar Setup
UserProfileData masterAvatar; UserProfileData masterAvatar;
if (scene.RegionInfo.MasterAvatarAssignedUUID != LLUUID.Zero) if (scene.RegionInfo.MasterAvatarAssignedUUID != LLUUID.Zero)
{ {
masterAvatar = m_commsManager.UserService.SetupMasterUser(scene.RegionInfo.MasterAvatarAssignedUUID); masterAvatar = m_commsManager.UserService.SetupMasterUser(scene.RegionInfo.MasterAvatarAssignedUUID);
scene.RegionInfo.MasterAvatarFirstName = masterAvatar.FirstName;
scene.RegionInfo.MasterAvatarLastName = masterAvatar.SurName;
} }
else else
{ {
@ -151,7 +154,7 @@ namespace OpenSim.Region.ClientStack
if (masterAvatar != null) if (masterAvatar != null)
{ {
m_log.Info("[PARCEL]: Found master avatar [" + masterAvatar.ID.ToString() + "]"); m_log.InfoFormat("[PARCEL]: Found master avatar {0} {1} [" + masterAvatar.ID.ToString() + "]", scene.RegionInfo.MasterAvatarFirstName, scene.RegionInfo.MasterAvatarLastName);
scene.RegionInfo.MasterAvatarAssignedUUID = masterAvatar.ID; scene.RegionInfo.MasterAvatarAssignedUUID = masterAvatar.ID;
} }
else else

View File

@ -123,15 +123,10 @@ namespace OpenSim.Region.Communications.OGS1
GridParams["server_uri"] = regionInfo.ServerURI; GridParams["server_uri"] = regionInfo.ServerURI;
GridParams["region_secret"] = regionInfo.regionSecret; GridParams["region_secret"] = regionInfo.regionSecret;
// part of an initial brutish effort to provide accurate information (as per the xml region spec) if(regionInfo.MasterAvatarAssignedUUID != LLUUID.Zero)
// wrt the ownership of a given region
// the (very bad) assumption is that this value is being read and handled inconsistently or
// not at all. Current strategy is to put the code in place to support the validity of this information
// and to roll forward debugging any issues from that point
//
// this particular section of the mod attempts to supply a value from the region's xml file to the grid
// server for the UUID of the region's owner (master avatar)
GridParams["master_avatar_uuid"] = regionInfo.MasterAvatarAssignedUUID.ToString(); GridParams["master_avatar_uuid"] = regionInfo.MasterAvatarAssignedUUID.ToString();
else
GridParams["master_avatar_uuid"] = regionInfo.EstateSettings.EstateOwner.ToString();
// Package into an XMLRPC Request // Package into an XMLRPC Request
ArrayList SendParams = new ArrayList(); ArrayList SendParams = new ArrayList();

View File

@ -28,6 +28,7 @@
using System; using System;
using System.Xml; using System.Xml;
using libsecondlife; using libsecondlife;
using OpenSim.Framework;
using OpenSim.Region.DataSnapshot.Interfaces; using OpenSim.Region.DataSnapshot.Interfaces;
using OpenSim.Region.Environment.Scenes; using OpenSim.Region.Environment.Scenes;
@ -50,15 +51,20 @@ namespace OpenSim.Region.DataSnapshot.Providers
public XmlNode RequestSnapshotData(XmlDocument factory) public XmlNode RequestSnapshotData(XmlDocument factory)
{ {
//Estate data section - contains who owns a set of sims and the name of the set. //Estate data section - contains who owns a set of sims and the name of the set.
//In Opensim all the estate names are the same as the Master Avatar (owner of the sim)
//Now in DataSnapshotProvider module form! //Now in DataSnapshotProvider module form!
XmlNode estatedata = factory.CreateNode(XmlNodeType.Element, "estate", ""); XmlNode estatedata = factory.CreateNode(XmlNodeType.Element, "estate", "");
LLUUID ownerid = m_scene.RegionInfo.MasterAvatarAssignedUUID; LLUUID ownerid = m_scene.RegionInfo.MasterAvatarAssignedUUID;
if (m_scene.RegionInfo.EstateSettings.EstateOwner != LLUUID.Zero)
ownerid = m_scene.RegionInfo.EstateSettings.EstateOwner;
// Can't fail because if it weren't in cache, we wouldn't be here
//
UserProfileData userProfile = m_scene.CommsManager.UserService.GetUserProfile(ownerid);
//TODO: Change to query userserver about the master avatar UUID ? //TODO: Change to query userserver about the master avatar UUID ?
String firstname = m_scene.RegionInfo.MasterAvatarFirstName; String firstname = userProfile.FirstName;
String lastname = m_scene.RegionInfo.MasterAvatarLastName; String lastname = userProfile.SurName;
//TODO: Fix the marshalling system to have less copypasta gruntwork //TODO: Fix the marshalling system to have less copypasta gruntwork
XmlNode user = factory.CreateNode(XmlNodeType.Element, "user", ""); XmlNode user = factory.CreateNode(XmlNodeType.Element, "user", "");

View File

@ -137,6 +137,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
// Try to retain the original creator/owner/lastowner if their uuid is present on this grid // Try to retain the original creator/owner/lastowner if their uuid is present on this grid
// otherwise, use the master avatar uuid instead // otherwise, use the master avatar uuid instead
LLUUID masterAvatarId = m_scene.RegionInfo.MasterAvatarAssignedUUID; LLUUID masterAvatarId = m_scene.RegionInfo.MasterAvatarAssignedUUID;
if (m_scene.RegionInfo.EstateSettings.EstateOwner != LLUUID.Zero)
masterAvatarId = m_scene.RegionInfo.EstateSettings.EstateOwner;
foreach (SceneObjectPart part in sceneObject.Children.Values) foreach (SceneObjectPart part in sceneObject.Children.Values)
{ {
if (!resolveUserUuid(part.CreatorID)) if (!resolveUserUuid(part.CreatorID))

View File

@ -212,6 +212,8 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
{ {
// EstateAccessDelta handles Estate Managers, Sim Access, Sim Banlist, allowed Groups.. etc. // EstateAccessDelta handles Estate Managers, Sim Access, Sim Banlist, allowed Groups.. etc.
if (user == m_scene.RegionInfo.EstateSettings.EstateOwner)
return; // never process EO
if (user == m_scene.RegionInfo.MasterAvatarAssignedUUID) if (user == m_scene.RegionInfo.MasterAvatarAssignedUUID)
return; // never process owner return; // never process owner
@ -557,6 +559,9 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
args.regionFlags = GetRegionFlags(); args.regionFlags = GetRegionFlags();
args.regionName = m_scene.RegionInfo.RegionName; args.regionName = m_scene.RegionInfo.RegionName;
if (m_scene.RegionInfo.EstateSettings.EstateOwner != LLUUID.Zero)
args.SimOwner = m_scene.RegionInfo.EstateSettings.EstateOwner;
else
args.SimOwner = m_scene.RegionInfo.MasterAvatarAssignedUUID; args.SimOwner = m_scene.RegionInfo.MasterAvatarAssignedUUID;
args.terrainBase0 = LLUUID.Zero; args.terrainBase0 = LLUUID.Zero;
args.terrainBase1 = LLUUID.Zero; args.terrainBase1 = LLUUID.Zero;
@ -811,6 +816,8 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
{ {
if (avatarID == m_scene.RegionInfo.MasterAvatarAssignedUUID) if (avatarID == m_scene.RegionInfo.MasterAvatarAssignedUUID)
return true; return true;
if (avatarID == m_scene.RegionInfo.EstateSettings.EstateOwner)
return true;
List<LLUUID> ems = new List<LLUUID>(m_scene.RegionInfo.EstateSettings.EstateManagers); List<LLUUID> ems = new List<LLUUID>(m_scene.RegionInfo.EstateSettings.EstateManagers);
if (ems.Contains(avatarID)) if (ems.Contains(avatarID))

View File

@ -162,6 +162,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land
ILandObject fullSimParcel = new LandObject(LLUUID.Zero, false, m_scene); ILandObject fullSimParcel = new LandObject(LLUUID.Zero, false, m_scene);
fullSimParcel.setLandBitmap(fullSimParcel.getSquareLandBitmap(0, 0, (int)Constants.RegionSize, (int)Constants.RegionSize)); fullSimParcel.setLandBitmap(fullSimParcel.getSquareLandBitmap(0, 0, (int)Constants.RegionSize, (int)Constants.RegionSize));
if(m_scene.RegionInfo.EstateSettings.EstateOwner != LLUUID.Zero)
fullSimParcel.landData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner;
else
fullSimParcel.landData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; fullSimParcel.landData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID;
fullSimParcel.landData.ClaimDate = Util.UnixTimeSinceEpoch(); fullSimParcel.landData.ClaimDate = Util.UnixTimeSinceEpoch();
AddLandObject(fullSimParcel); AddLandObject(fullSimParcel);
@ -931,6 +934,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land
{ {
if (m_scene.ExternalChecks.ExternalChecksCanAbandonParcel(remote_client.AgentId, landList[local_id])) if (m_scene.ExternalChecks.ExternalChecksCanAbandonParcel(remote_client.AgentId, landList[local_id]))
{ {
if(m_scene.RegionInfo.EstateSettings.EstateOwner != LLUUID.Zero)
landList[local_id].landData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner;
else
landList[local_id].landData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; landList[local_id].landData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID;
m_scene.Broadcast(SendParcelOverlay); m_scene.Broadcast(SendParcelOverlay);
landList[local_id].sendLandUpdateToClient(remote_client); landList[local_id].sendLandUpdateToClient(remote_client);
@ -945,6 +951,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land
{ {
if (m_scene.ExternalChecks.ExternalChecksCanReclaimParcel(remote_client.AgentId, landList[local_id])) if (m_scene.ExternalChecks.ExternalChecksCanReclaimParcel(remote_client.AgentId, landList[local_id]))
{ {
if(m_scene.RegionInfo.EstateSettings.EstateOwner != LLUUID.Zero)
landList[local_id].landData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner;
else
landList[local_id].landData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; landList[local_id].landData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID;
landList[local_id].landData.ClaimDate = Util.UnixTimeSinceEpoch(); landList[local_id].landData.ClaimDate = Util.UnixTimeSinceEpoch();
m_scene.Broadcast(SendParcelOverlay); m_scene.Broadcast(SendParcelOverlay);

View File

@ -32,6 +32,7 @@ using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Reflection; using System.Reflection;
using log4net; using log4net;
using OpenSim.Framework;
using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Interfaces;
using OpenSim.Region.Environment.Modules.Framework; using OpenSim.Region.Environment.Modules.Framework;
using OpenSim.Region.Environment.Modules.Framework.InterfaceCommander; using OpenSim.Region.Environment.Modules.Framework.InterfaceCommander;
@ -63,6 +64,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
private bool m_bypassPermissions = false; private bool m_bypassPermissions = false;
private bool m_bypassPermissionsValue = true; private bool m_bypassPermissionsValue = true;
private bool m_debugPermissions = false; private bool m_debugPermissions = false;
private bool m_allowGridGods = false;
#endregion #endregion
@ -136,6 +138,8 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
if (!modules.Contains("DefaultPermissionsModule")) if (!modules.Contains("DefaultPermissionsModule"))
return; return;
m_allowGridGods = myConfig.GetBoolean("allow_grid_gods", false);
m_bypassPermissions = !myConfig.GetBoolean("serverside_object_permissions", true); m_bypassPermissions = !myConfig.GetBoolean("serverside_object_permissions", true);
if (m_bypassPermissions) if (m_bypassPermissions)
@ -231,11 +235,6 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
protected bool IsAdministrator(LLUUID user) protected bool IsAdministrator(LLUUID user)
{ {
// m_log.DebugFormat(
// "[PERMISSIONS]: Is adminstrator called for {0} where region master avatar is {1}",
// user, m_scene.RegionInfo.MasterAvatarAssignedUUID);
// If there is no master avatar, return false
if (m_scene.RegionInfo.MasterAvatarAssignedUUID != LLUUID.Zero) if (m_scene.RegionInfo.MasterAvatarAssignedUUID != LLUUID.Zero)
{ {
if (m_scene.RegionInfo.MasterAvatarAssignedUUID == user) if (m_scene.RegionInfo.MasterAvatarAssignedUUID == user)
@ -246,7 +245,9 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
if (m_scene.RegionInfo.EstateSettings.EstateOwner == user) if (m_scene.RegionInfo.EstateSettings.EstateOwner == user)
return true; return true;
} }
UserProfileData userProfile = m_scene.CommsManager.UserService.GetUserProfile(user);
if((userProfile.GodLevel) >= 200 && m_allowGridGods)
return true;
return false; return false;
} }

View File

@ -116,6 +116,8 @@ namespace OpenSim.Region.Environment.Scenes
{ {
userlevel = 1; userlevel = 1;
} }
// TODO: remove this cruft once MasterAvatar is fully deprecated
//
if (m_regInfo.MasterAvatarAssignedUUID == AgentID) if (m_regInfo.MasterAvatarAssignedUUID == AgentID)
{ {
userlevel = 2; userlevel = 2;

View File

@ -3777,5 +3777,22 @@ namespace OpenSim.Region.Environment.Scenes
//Console.WriteLine("Terrain packet unacked, resending patch: " + patchX + " , " + patchY); //Console.WriteLine("Terrain packet unacked, resending patch: " + patchX + " , " + patchY);
client.SendLayerData(patchX, patchY, Heightmap.GetFloatsSerialised()); client.SendLayerData(patchX, patchY, Heightmap.GetFloatsSerialised());
} }
// public bool IsAdministrator(LLUUID user)
// {
// if(RegionInfo.MasterAvatarAssignedUUID != LLUUID.Zero)
// {
// if(RegionInfo.MasterAvatarAssignedUUID == user)
// return true;
// }
//
// UserProfileData userProfile =
// CommsManager.UserService.GetUserProfile(user);
//
// if(userProfile.GodLevel >= 200)
// return true;
//
// return false;
// }
} }
} }

View File

@ -2017,7 +2017,15 @@ namespace OpenSim.Region.Environment.Scenes
{ {
if (godStatus) if (godStatus)
{ {
m_godlevel = 250; // TODO: remove this cruft once the master avatar is fully
// deprecated. For now, assign god level 200 to anyone
// who is granted god powers, but has no god level set.
//
UserProfileData userProfile = m_scene.CommsManager.UserService.GetUserProfile(agentID);
if(userProfile.GodLevel > 0)
m_godlevel = userProfile.GodLevel;
else
m_godlevel = 200;
} }
else else
{ {