add more calls to effective permissions aggregation, some paths may still be missing on objects changes, but remove the aggregation on check paths, so all can be tested.

httptests
UbitUmarov 2017-01-17 13:24:09 +00:00
parent 1113407280
commit db2fbf6516
14 changed files with 58 additions and 30 deletions

View File

@ -121,6 +121,9 @@ namespace OpenSim.Region.ClientStack.Linden
OSD r = OSDParser.DeserializeLLSDXml((string)request["requestbody"]);
if (r.Type != OSDType.Map) // not a proper req
return responsedata;
//UUID session_id = UUID.Zero;
bool bypass_raycast = false;
uint everyone_mask = 0;
@ -157,9 +160,6 @@ namespace OpenSim.Region.ClientStack.Linden
int state = 0;
int lastattach = 0;
if (r.Type != OSDType.Map) // not a proper req
return responsedata;
OSDMap rm = (OSDMap)r;
if (rm.ContainsKey("ObjectData")) //v2
@ -307,8 +307,6 @@ namespace OpenSim.Region.ClientStack.Linden
}
}
Vector3 pos = m_scene.GetNewRezLocation(ray_start, ray_end, ray_target_id, rotation, (bypass_raycast) ? (byte)1 : (byte)0, (ray_end_is_intersection) ? (byte)1 : (byte)0, true, scale, false);
PrimitiveBaseShape pbs = PrimitiveBaseShape.CreateBox();
@ -359,6 +357,8 @@ namespace OpenSim.Region.ClientStack.Linden
rootpart.NextOwnerMask = next_owner_mask;
rootpart.Material = (byte)material;
obj.AggregatePerms();
m_scene.PhysicsScene.AddPhysicsActorTaint(rootpart.PhysActor);
responsedata["int_response_code"] = 200; //501; //410; //404;

View File

@ -335,6 +335,7 @@ namespace OpenSim.Region.ClientStack.Linden
grp.AbsolutePosition = obj.Position;
prim.RotationOffset = obj.Rotation;
// Required for linking
grp.RootPart.ClearUpdateSchedule();

View File

@ -338,6 +338,7 @@ namespace OpenSim.Region.Framework.Scenes
// Update item with new asset
item.AssetID = asset.FullID;
group.UpdateInventoryItem(item);
group.AggregatePerms();
part.SendPropertiesToClient(remoteClient);
@ -1214,6 +1215,7 @@ namespace OpenSim.Region.Framework.Scenes
}
group.RemoveInventoryItem(localID, itemID);
group.AggregatePerms();
}
part.SendPropertiesToClient(remoteClient);
@ -1530,9 +1532,10 @@ namespace OpenSim.Region.Framework.Scenes
destTaskItem.Type = srcTaskItem.Type;
destPart.Inventory.AddInventoryItem(destTaskItem, part.OwnerID != destPart.OwnerID);
if ((srcTaskItem.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
{
part.Inventory.RemoveInventoryItem(itemId);
}
ScenePresence avatar;
@ -1978,6 +1981,8 @@ namespace OpenSim.Region.Framework.Scenes
part.Inventory.AddInventoryItem(taskItem, false);
part.Inventory.CreateScriptInstance(taskItem, 0, false, DefaultScriptEngine, 0);
part.ParentGroup.AggregatePerms();
// tell anyone managing scripts that a new script exists
EventManager.TriggerNewScript(agentID, part, taskItem.ItemID);
@ -2658,6 +2663,7 @@ namespace OpenSim.Region.Framework.Scenes
// We can only call this after adding the scene object, since the scene object references the scene
// to find out if scripts should be activated at all.
group.AggregatePerms();
group.CreateScriptInstances(param, true, DefaultScriptEngine, 3);
group.ScheduleGroupForFullUpdate();

View File

@ -2351,6 +2351,7 @@ namespace OpenSim.Region.Framework.Scenes
EventManager.TriggerOnSceneObjectLoaded(group);
SceneObjectPart rootPart = group.GetPart(group.UUID);
rootPart.Flags &= ~PrimFlags.Scripted;
group.AggregateDeepPerms();
rootPart.TrimPermissions();
// Don't do this here - it will get done later on when sculpt data is loaded.
@ -2622,6 +2623,7 @@ namespace OpenSim.Region.Framework.Scenes
if (UserManagementModule != null)
sceneObject.RootPart.CreatorIdentification = UserManagementModule.GetUserUUI(ownerID);
sceneObject.AggregateDeepPerms();
sceneObject.ScheduleGroupForFullUpdate();
return sceneObject;

View File

@ -343,7 +343,7 @@ namespace OpenSim.Region.Framework.Scenes
sceneObject.ForceInventoryPersistence();
sceneObject.HasGroupChanged = true;
}
sceneObject.AggregateDeepPerms();
return ret;
}

View File

@ -171,7 +171,7 @@ namespace OpenSim.Region.Framework.Scenes
bool addFromAllowedDrop = agentID != part.OwnerID;
part.Inventory.AddInventoryItem(taskItem, addFromAllowedDrop);
part.ParentGroup.AggregatePerms();
return true;
}
else
@ -259,7 +259,7 @@ namespace OpenSim.Region.Framework.Scenes
// this can't be done here but on every place where a change may happen (rez, (de)link, contents , perms, etc)
// bc this is on heavy duty code paths
// but for now we need to test the concept
AggregateDeepPerms();
// AggregateDeepPerms();
return m_EffectiveEveryOnePerms;
}
}
@ -272,7 +272,7 @@ namespace OpenSim.Region.Framework.Scenes
// this can't be done here but on every place where a change may happen (rez, (de)link, contents , perms, etc)
// bc this is on heavy duty code paths
// but for now we need to test the concept
AggregateDeepPerms();
// AggregateDeepPerms();
return m_EffectiveGroupPerms;
}
}
@ -285,7 +285,7 @@ namespace OpenSim.Region.Framework.Scenes
// this can't be done here but on every place where a change may happen (rez, (de)link, contents , perms, etc)
// bc this is on heavy duty code paths
// but for now we need to test the concept
AggregateDeepPerms();
// AggregateDeepPerms();
return m_EffectiveGroupOrEveryOnePerms;
}
}
@ -298,7 +298,7 @@ namespace OpenSim.Region.Framework.Scenes
// this can't be done here but on every place where a change may happen (rez, (de)link, contents , perms, etc)
// bc this is on heavy duty code paths
// but for now we need to test the concept
AggregateDeepPerms();
// AggregateDeepPerms();
return m_EffectiveOwnerPerms;
}
}

View File

@ -2441,7 +2441,6 @@ namespace OpenSim.Region.Framework.Scenes
dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed);
dupe.m_rootPart.LinkNum = m_rootPart.LinkNum;
if (userExposed)
dupe.m_rootPart.TrimPermissions();
@ -2503,10 +2502,12 @@ namespace OpenSim.Region.Framework.Scenes
if (dupe.m_rootPart.PhysActor != null)
dupe.m_rootPart.PhysActor.Building = false; // tell physics to finish building
dupe.AggregateDeepPerms();
dupe.HasGroupChanged = true;
dupe.AttachToBackup();
ScheduleGroupForFullUpdate();
dupe.ScheduleGroupForFullUpdate();
}
m_dupeInProgress = false;
@ -3426,6 +3427,7 @@ namespace OpenSim.Region.Framework.Scenes
objectGroup.HasGroupChangedDueToDelink = true;
InvalidBoundsRadius();
objectGroup.AggregatePerms();
if (sendEvents)
linkPart.TriggerScriptChangedEvent(Changed.LINK);
@ -3964,8 +3966,8 @@ namespace OpenSim.Region.Framework.Scenes
public void AdjustChildPrimPermissions(bool forceTaskInventoryPermissive)
{
uint newOwnerMask = (uint)(PermissionMask.All | PermissionMask.Export) & 0xfffffff8; // Mask folded bits
uint foldedPerms = RootPart.OwnerMask & 3;
uint newOwnerMask = (uint)(PermissionMask.All | PermissionMask.Export) & 0xfffffff0; // Mask folded bits
uint foldedPerms = RootPart.OwnerMask & (uint)PermissionMask.FoldedMask;
ForEachPart(part =>
{
@ -3976,14 +3978,14 @@ namespace OpenSim.Region.Framework.Scenes
part.Inventory.ApplyGodPermissions(part.BaseMask);
});
uint lockMask = ~(uint)(PermissionMask.Move | PermissionMask.Modify);
uint lockBit = RootPart.OwnerMask & (uint)(PermissionMask.Move | PermissionMask.Modify);
uint lockMask = ~(uint)(PermissionMask.Move);
uint lockBit = RootPart.OwnerMask & (uint)(PermissionMask.Move);
RootPart.OwnerMask = (RootPart.OwnerMask & lockBit) | ((newOwnerMask | foldedPerms) & lockMask);
// m_log.DebugFormat(
// "[SCENE OBJECT GROUP]: RootPart.OwnerMask now {0} for {1} in {2}",
// (OpenMetaverse.PermissionMask)RootPart.OwnerMask, Name, Scene.Name);
AggregatePerms();
RootPart.ScheduleFullUpdate();
}
@ -4008,6 +4010,7 @@ namespace OpenSim.Region.Framework.Scenes
{
foreach (SceneObjectPart part in Parts)
part.Inventory.ApplyGodPermissions(RootPart.BaseMask);
AggregatePerms();
}
HasGroupChanged = true;
@ -5223,6 +5226,7 @@ namespace OpenSim.Region.Framework.Scenes
{
part.ResetOwnerChangeFlag();
});
AggregatePerms();
}
// clear some references to easy cg

View File

@ -476,8 +476,8 @@ namespace OpenSim.Region.Framework.Scenes
APIDActive = false;
Flags = 0;
CreateSelected = true;
TrimPermissions();
AggregateInnerPerms();
}
#endregion Constructors
@ -4495,7 +4495,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
break;
}
AggregateInnerPerms();
SendFullUpdateToAllClients();
}
}
@ -4512,6 +4512,8 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
EveryoneMask = source.EveryoneMask & BaseMask;
NextOwnerMask = source.NextOwnerMask & BaseMask;
AggregateInnerPerms();
if (OwnerMask != prevOwnerMask ||
GroupMask != prevGroupMask ||
EveryoneMask != prevEveryoneMask ||
@ -5335,6 +5337,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
item.OwnerChanged = false;
Inventory.UpdateInventoryItem(item, false, false);
}
AggregateInnerPerms();
}
/// <summary>

View File

@ -807,6 +807,7 @@ namespace OpenSim.Region.Framework.Scenes
else
m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
m_part.AggregateInnerPerms();
m_inventorySerial++;
//m_inventorySerial += 2;
HasInventoryChanged = true;
@ -829,7 +830,7 @@ namespace OpenSim.Region.Framework.Scenes
// m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
}
m_items.LockItemsForWrite(false);
m_part.AggregateInnerPerms();
m_inventorySerial++;
}
@ -1022,16 +1023,20 @@ namespace OpenSim.Region.Framework.Scenes
item.AssetID = m_items[item.ItemID].AssetID;
m_items[item.ItemID] = item;
m_inventorySerial++;
if (fireScriptEvents)
m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
if (considerChanged)
{
m_part.AggregateInnerPerms();
m_part.ParentGroup.AggregatePerms();
HasInventoryChanged = true;
m_part.ParentGroup.HasGroupChanged = true;
}
m_items.LockItemsForWrite(false);
return true;
}
else
@ -1068,6 +1073,10 @@ namespace OpenSim.Region.Framework.Scenes
m_items.LockItemsForWrite(true);
m_items.Remove(itemID);
m_items.LockItemsForWrite(false);
m_part.AggregateInnerPerms();
m_part.ParentGroup.AggregatePerms();
m_inventorySerial++;
m_part.TriggerScriptChangedEvent(Changed.INVENTORY);

View File

@ -114,7 +114,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
// Script state may, or may not, exist. Not having any, is NOT
// ever a problem.
sceneObject.LoadScriptState(reader);
sceneObject.AggregateDeepPerms();
return sceneObject;
}
@ -278,7 +278,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
// Script state may, or may not, exist. Not having any, is NOT
// ever a problem.
sceneObject.LoadScriptState(doc);
sceneObject.AggregatePerms();
return sceneObject;
}
catch (Exception e)
@ -1739,6 +1739,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
reader.ReadEndElement(); // SceneObjectPart
obj.AggregateInnerPerms();
// m_log.DebugFormat("[SceneObjectSerializer]: parsed SOP {0} {1}", obj.Name, obj.UUID);
return obj;
}

View File

@ -70,6 +70,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
//obj.RegenerateFullIDs();
scene.AddNewSceneObject(obj, true);
obj.AggregateDeepPerms();
}
}
else

View File

@ -665,7 +665,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
taskItem.AssetID = asset.FullID;
host.Inventory.AddInventoryItem(taskItem, false);
host.ParentGroup.AggregatePerms();
m_comms.DispatchReply(scriptID,1,assetID.ToString(),reqID.ToString());
}

View File

@ -525,7 +525,7 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator
m_scene.AddNewSceneObject(sceneObject, true);
sceneObject.SetGroup(groupID, null);
sceneObject.AggregatePerms();
return sceneObject;
}

View File

@ -2038,6 +2038,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.Inventory.AddInventoryItemExclusive(taskItem, false);
else
m_host.Inventory.AddInventoryItem(taskItem, false);
m_host.ParentGroup.AggregatePerms();
return taskItem;
}