mirror of
https://github.com/opensim/opensim.git
synced 2026-08-13 13:15:44 +08:00
Merge branch 'master' into httptests
This commit is contained in:
@@ -1118,7 +1118,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
|
||||
SceneObjectGroup objatt;
|
||||
|
||||
UUID rezGroupID = sp.ControllingClient.ActiveGroupId;
|
||||
UUID rezGroupID;
|
||||
|
||||
// This will fail if the user aborts login. sp will exist
|
||||
// but ControllintClient will be null.
|
||||
try
|
||||
{
|
||||
rezGroupID = sp.ControllingClient.ActiveGroupId;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (itemID != UUID.Zero)
|
||||
objatt = m_invAccessModule.RezObject(sp.ControllingClient,
|
||||
|
||||
@@ -369,6 +369,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
|
||||
public virtual bool SendFriendsOnlineIfNeeded(IClientAPI client)
|
||||
{
|
||||
if (client == null)
|
||||
return false;
|
||||
|
||||
UUID agentID = client.AgentId;
|
||||
|
||||
// Check if the online friends list is needed
|
||||
|
||||
@@ -194,14 +194,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
|
||||
int godlevel = 200;
|
||||
// update level so higher gods can kick lower ones
|
||||
ScenePresence god = m_scene.GetScenePresence(godID);
|
||||
if(god != null && god.GodController.GodLevel > godlevel)
|
||||
godlevel = god.GodController.GodLevel;
|
||||
if(god != null && god.GodController.EffectiveLevel > godlevel)
|
||||
godlevel = god.GodController.EffectiveLevel;
|
||||
|
||||
if(agentID == ALL_AGENTS)
|
||||
{
|
||||
m_scene.ForEachRootScenePresence(delegate(ScenePresence p)
|
||||
{
|
||||
if (p.UUID != godID && godlevel > p.GodController.GodLevel)
|
||||
if (p.UUID != godID && godlevel > p.GodController.EffectiveLevel)
|
||||
doKickmodes(godID, p, kickflags, reason);
|
||||
});
|
||||
return;
|
||||
@@ -224,7 +224,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
|
||||
return;
|
||||
}
|
||||
|
||||
if (godlevel <= sp.GodController.GodLevel) // no god wars
|
||||
if (godlevel <= sp.GodController.EffectiveLevel) // no god wars
|
||||
return;
|
||||
|
||||
if(sp.UUID == godID)
|
||||
|
||||
@@ -1999,8 +1999,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
|
||||
IClientAPI spClient = sp.ControllingClient;
|
||||
|
||||
if (!seeds.ContainsKey(currentRegionHandler))
|
||||
seeds.Add(currentRegionHandler, spClient.RequestClientInfo().CapsPath);
|
||||
// This will fail if the user aborts login
|
||||
try
|
||||
{
|
||||
if (!seeds.ContainsKey(currentRegionHandler))
|
||||
seeds.Add(currentRegionHandler, spClient.RequestClientInfo().CapsPath);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
AgentCircuitData currentAgentCircuit =
|
||||
spScene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode);
|
||||
|
||||
@@ -322,7 +322,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
|
||||
bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment)
|
||||
{
|
||||
m_log.DebugFormat("[HGScene]: RezObject itemID={0} fromTaskID={1}", itemID, fromTaskID);
|
||||
//m_log.DebugFormat("[HGScene]: RezObject itemID={0} fromTaskID={1}", itemID, fromTaskID);
|
||||
|
||||
//if (fromTaskID.Equals(UUID.Zero))
|
||||
//{
|
||||
|
||||
@@ -532,17 +532,13 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
}
|
||||
else
|
||||
{
|
||||
AddPermissions(item, objlist[0], objlist, remoteClient);
|
||||
|
||||
item.CreationDate = Util.UnixTimeSinceEpoch();
|
||||
item.Description = asset.Description;
|
||||
item.Name = asset.Name;
|
||||
item.AssetType = asset.Type;
|
||||
|
||||
//preserve perms on return
|
||||
if(DeRezAction.Return == action)
|
||||
AddPermissions(item, objlist[0], objlist, null);
|
||||
else
|
||||
AddPermissions(item, objlist[0], objlist, remoteClient);
|
||||
|
||||
m_Scene.AddInventoryItem(item);
|
||||
|
||||
if (remoteClient != null && item.Owner == remoteClient.AgentId)
|
||||
@@ -599,15 +595,16 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
}
|
||||
effectivePerms |= (uint)PermissionMask.Move;
|
||||
|
||||
//PermissionsUtil.LogPermissions(item.Name, "Before AddPermissions", item.BasePermissions, item.CurrentPermissions, item.NextPermissions);
|
||||
|
||||
if (remoteClient != null && (remoteClient.AgentId != so.RootPart.OwnerID) && m_Scene.Permissions.PropagatePermissions())
|
||||
{
|
||||
// Changing ownership, so apply the "Next Owner" permissions to all of the
|
||||
// inventory item's permissions.
|
||||
|
||||
uint perms = effectivePerms;
|
||||
PermissionsUtil.ApplyFoldedPermissions(effectivePerms, ref perms);
|
||||
uint nextPerms = (perms & 7) << 13;
|
||||
if ((nextPerms & (uint)PermissionMask.Copy) == 0)
|
||||
perms &= ~(uint)PermissionMask.Copy;
|
||||
if ((nextPerms & (uint)PermissionMask.Transfer) == 0)
|
||||
perms &= ~(uint)PermissionMask.Transfer;
|
||||
if ((nextPerms & (uint)PermissionMask.Modify) == 0)
|
||||
perms &= ~(uint)PermissionMask.Modify;
|
||||
|
||||
item.BasePermissions = perms & so.RootPart.NextOwnerMask;
|
||||
item.CurrentPermissions = item.BasePermissions;
|
||||
@@ -620,13 +617,6 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
}
|
||||
else
|
||||
{
|
||||
// Not changing ownership.
|
||||
// In this case we apply the permissions in the object's items ONLY to the inventory
|
||||
// item's "Next Owner" permissions, but NOT to its "Current", "Base", etc. permissions.
|
||||
// E.g., if the object contains a No-Transfer item then the item's "Next Owner"
|
||||
// permissions are also No-Transfer.
|
||||
PermissionsUtil.ApplyFoldedPermissions(effectivePerms, ref allObjectsNextOwnerPerms);
|
||||
|
||||
item.BasePermissions = effectivePerms;
|
||||
item.CurrentPermissions = effectivePerms;
|
||||
item.NextPermissions = so.RootPart.NextOwnerMask & effectivePerms;
|
||||
@@ -640,10 +630,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
(uint)PermissionMask.Move |
|
||||
(uint)PermissionMask.Export |
|
||||
7); // Preserve folded permissions
|
||||
}
|
||||
|
||||
//PermissionsUtil.LogPermissions(item.Name, "After AddPermissions", item.BasePermissions, item.CurrentPermissions, item.NextPermissions);
|
||||
|
||||
}
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
@@ -1153,6 +1141,12 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
part.OwnerID = item.Owner;
|
||||
part.RezzerID = item.Owner;
|
||||
part.Inventory.ChangeInventoryOwner(item.Owner);
|
||||
|
||||
// This applies the base mask from the item as the next
|
||||
// permissions for the object. This is correct because the
|
||||
// giver's base mask was masked by the giver's next owner
|
||||
// mask, so the base mask equals the original next owner mask.
|
||||
part.NextOwnerMask = item.BasePermissions;
|
||||
}
|
||||
|
||||
so.ApplyNextOwnerPermissions();
|
||||
@@ -1164,10 +1158,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
{
|
||||
if ((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0)
|
||||
{
|
||||
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0)
|
||||
part.EveryoneMask = item.EveryOnePermissions & part.BaseMask;
|
||||
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0)
|
||||
part.NextOwnerMask = item.NextPermissions & part.BaseMask;
|
||||
part.EveryoneMask = item.EveryOnePermissions & part.BaseMask;
|
||||
part.NextOwnerMask = item.NextPermissions & part.BaseMask;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1818,13 +1818,20 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
uint wx;
|
||||
uint wy;
|
||||
Util.RegionHandleToWorldLoc(regionHandle, out wx, out wy);
|
||||
wx += x;
|
||||
wy += y;
|
||||
GridRegion info = m_scene.GridService.GetRegionByPosition(scope, (int)wx, (int)wy);
|
||||
if(info != null)
|
||||
{
|
||||
wx -= (uint)info.RegionLocX;
|
||||
wy -= (uint)info.RegionLocY;
|
||||
wx += x;
|
||||
wy += y;
|
||||
// Firestorm devs have no ideia how to do handlers math
|
||||
// on all cases
|
||||
if(wx > info.RegionSizeX || wy > info.RegionSizeY)
|
||||
{
|
||||
wx = x;
|
||||
wy = y;
|
||||
}
|
||||
parcelID = Util.BuildFakeParcelID(info.RegionHandle, wx, wy);
|
||||
}
|
||||
}
|
||||
@@ -1845,8 +1852,6 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
parcelID = Util.BuildFakeParcelID(info.RegionHandle, x, y);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
catch (LLSD.LLSDParseException e)
|
||||
|
||||
@@ -211,7 +211,13 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell
|
||||
item.InvType = (int)InventoryType.Object;
|
||||
item.Folder = categoryID;
|
||||
|
||||
PermissionsUtil.ApplyFoldedPermissions(perms, ref perms);
|
||||
uint nextPerms=(perms & 7) << 13;
|
||||
if ((nextPerms & (uint)PermissionMask.Copy) == 0)
|
||||
perms &= ~(uint)PermissionMask.Copy;
|
||||
if ((nextPerms & (uint)PermissionMask.Transfer) == 0)
|
||||
perms &= ~(uint)PermissionMask.Transfer;
|
||||
if ((nextPerms & (uint)PermissionMask.Modify) == 0)
|
||||
perms &= ~(uint)PermissionMask.Modify;
|
||||
|
||||
item.BasePermissions = perms & part.NextOwnerMask;
|
||||
item.CurrentPermissions = perms & part.NextOwnerMask;
|
||||
|
||||
@@ -99,7 +99,9 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||
private bool m_allowGridGods = false;
|
||||
private bool m_RegionOwnerIsGod = false;
|
||||
private bool m_RegionManagerIsGod = false;
|
||||
private bool m_ParcelOwnerIsGod = false;
|
||||
private bool m_forceGridGodsOnly;
|
||||
private bool m_forceGodModeAlwaysOn;
|
||||
private bool m_allowGodActionsWithoutGodMode;
|
||||
|
||||
private bool m_SimpleBuildPermissions = false;
|
||||
|
||||
@@ -168,21 +170,27 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||
|
||||
m_Enabled = true;
|
||||
|
||||
m_allowGridGods = Util.GetConfigVarFromSections<bool>(config, "allow_grid_gods",
|
||||
new string[] { "Startup", "Permissions" }, false);
|
||||
m_bypassPermissions = !Util.GetConfigVarFromSections<bool>(config, "serverside_object_permissions",
|
||||
new string[] { "Startup", "Permissions" }, true);
|
||||
m_propagatePermissions = Util.GetConfigVarFromSections<bool>(config, "propagate_permissions",
|
||||
new string[] { "Startup", "Permissions" }, true);
|
||||
m_RegionOwnerIsGod = Util.GetConfigVarFromSections<bool>(config, "region_owner_is_god",
|
||||
new string[] { "Startup", "Permissions" }, true);
|
||||
m_RegionManagerIsGod = Util.GetConfigVarFromSections<bool>(config, "region_manager_is_god",
|
||||
new string[] { "Startup", "Permissions" }, false);
|
||||
m_ParcelOwnerIsGod = Util.GetConfigVarFromSections<bool>(config, "parcel_owner_is_god",
|
||||
new string[] { "Startup", "Permissions" }, false);
|
||||
string[] sections = new string[] { "Startup", "Permissions" };
|
||||
|
||||
m_SimpleBuildPermissions = Util.GetConfigVarFromSections<bool>(config, "simple_build_permissions",
|
||||
new string[] { "Startup", "Permissions" }, false);
|
||||
m_allowGridGods = Util.GetConfigVarFromSections<bool>(config, "allow_grid_gods", sections, false);
|
||||
m_bypassPermissions = !Util.GetConfigVarFromSections<bool>(config, "serverside_object_permissions", sections, true);
|
||||
m_propagatePermissions = Util.GetConfigVarFromSections<bool>(config, "propagate_permissions", sections, true);
|
||||
|
||||
m_forceGridGodsOnly = Util.GetConfigVarFromSections<bool>(config, "force_grid_gods_only", sections, false);
|
||||
if(!m_forceGridGodsOnly)
|
||||
{
|
||||
m_RegionOwnerIsGod = Util.GetConfigVarFromSections<bool>(config, "region_owner_is_god",sections, true);
|
||||
m_RegionManagerIsGod = Util.GetConfigVarFromSections<bool>(config, "region_manager_is_god",sections, false);
|
||||
}
|
||||
else
|
||||
m_allowGridGods = true;
|
||||
|
||||
m_forceGodModeAlwaysOn = Util.GetConfigVarFromSections<bool>(config, "automatic_gods", sections, false);
|
||||
m_allowGodActionsWithoutGodMode = Util.GetConfigVarFromSections<bool>(config, "implicit_gods", sections, false);
|
||||
if(m_allowGodActionsWithoutGodMode)
|
||||
m_forceGodModeAlwaysOn = false;
|
||||
|
||||
m_SimpleBuildPermissions = Util.GetConfigVarFromSections<bool>(config, "simple_build_permissions",sections, false);
|
||||
|
||||
m_allowedScriptCreators
|
||||
= ParseUserSetConfigSetting(config, "allowed_script_creators", m_allowedScriptCreators);
|
||||
@@ -718,6 +726,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||
if (IsAdministrator(user))
|
||||
return PermissionClass.Owner;
|
||||
|
||||
/* to review later
|
||||
// Users should be able to edit what is over their land.
|
||||
Vector3 taskPos = obj.AbsolutePosition;
|
||||
ILandObject parcel = m_scene.LandChannel.GetLandObject(taskPos.X, taskPos.Y);
|
||||
@@ -727,7 +736,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||
if (!IsAdministrator(objectOwner))
|
||||
return PermissionClass.Owner;
|
||||
}
|
||||
|
||||
*/
|
||||
// Group permissions
|
||||
if ((obj.GroupID != UUID.Zero) && IsGroupMember(obj.GroupID, user, 0))
|
||||
return PermissionClass.Group;
|
||||
|
||||
Reference in New Issue
Block a user