Merge branch 'master' of ssh://opensimulator.org/var/git/opensim

httptests
Diva Canto 2017-05-01 10:09:54 -07:00
commit 8e88a9d702
3 changed files with 28 additions and 40 deletions

View File

@ -579,26 +579,19 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
IClientAPI remoteClient)
{
uint effectivePerms = (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify | PermissionMask.Move | PermissionMask.Export | PermissionMask.FoldedMask);
// For the porposes of inventory, an object is modify if the prims
// are modify. This allows renaming an object that contains no
// mod items.
foreach (SceneObjectGroup grp in objsForEffectivePermissions)
{
uint groupPerms = grp.GetEffectivePermissions(true);
// if ((grp.RootPart.BaseMask & (uint)PermissionMask.Modify) != 0)
// groupPerms |= (uint)PermissionMask.Modify;
effectivePerms &= groupPerms;
effectivePerms &= grp.CurrentAndFoldedNextPermissions();
}
if (remoteClient != null && (remoteClient.AgentId != so.RootPart.OwnerID) && m_Scene.Permissions.PropagatePermissions())
{
// apply parts inventory items next owner
PermissionsUtil.ApplyNoModFoldedPermissions(effectivePerms, ref effectivePerms);
// change to next owner
uint basePerms = effectivePerms & so.RootPart.NextOwnerMask;
// rebuild folded perms since we don't have then on inworld objects
// fix and update folded
basePerms = PermissionsUtil.FixAndFoldPermissions(basePerms);
item.BasePermissions = basePerms;

View File

@ -118,6 +118,11 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell
return false;
SceneObjectGroup group = part.ParentGroup;
if(group == null || group.IsDeleted || group.inTransit)
return false;
// make sure we are not buying a child part
part = group.RootPart;
switch (saleType)
{
@ -157,18 +162,6 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell
break;
case 2: // Sell a copy
Vector3 inventoryStoredPosition = new Vector3(
Math.Min(group.AbsolutePosition.X, m_scene.RegionInfo.RegionSizeX - 6),
Math.Min(group.AbsolutePosition.Y, m_scene.RegionInfo.RegionSizeY - 6),
group.AbsolutePosition.Z);
Vector3 originalPosition = group.AbsolutePosition;
group.AbsolutePosition = inventoryStoredPosition;
string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(group);
group.AbsolutePosition = originalPosition;
uint perms = group.EffectiveOwnerPerms;
if ((perms & (uint)PermissionMask.Transfer) == 0)
@ -185,6 +178,8 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell
return false;
}
string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(group);
AssetBase asset = m_scene.CreateAsset(
group.GetPartName(localID),
group.GetPartDescription(localID),
@ -206,12 +201,12 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell
item.InvType = (int)InventoryType.Object;
item.Folder = categoryID;
perms = group.GetEffectivePermissions(false);
perms = group.CurrentAndFoldedNextPermissions();
// apply parts inventory next perms
PermissionsUtil.ApplyNoModFoldedPermissions(perms, ref perms);
perms &= part.NextOwnerMask;
// change to next owner perms
perms &= part.NextOwnerMask;
// update folded
perms = PermissionsUtil.FixAndFoldPermissions(perms);
item.BasePermissions = perms;

View File

@ -338,6 +338,8 @@ namespace OpenSim.Region.Framework.Scenes
uint rootEveryonePerms = RootPart.EveryoneMask;
uint everyone = rootEveryonePerms;
// date is time of writing april 30th 2017
bool newObject = (RootPart.CreationDate == 0 || RootPart.CreationDate > 1493574994);
SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
{
@ -345,7 +347,8 @@ namespace OpenSim.Region.Framework.Scenes
part.AggregateInnerPerms();
owner &= part.AggregatedInnerOwnerPerms;
group &= part.AggregatedInnerGroupPerms;
everyone &= part.AggregatedInnerEveryonePerms;
if(newObject)
everyone &= part.AggregatedInnerEveryonePerms;
}
// recover modify and move
rootOwnerPerms &= movemodmask;
@ -407,14 +410,16 @@ namespace OpenSim.Region.Framework.Scenes
uint everyone = rootEveryonePerms;
bool needUpdate = false;
// date is time of writing april 30th 2017
bool newObject = (RootPart.CreationDate == 0 || RootPart.CreationDate > 1493574994);
SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
{
SceneObjectPart part = parts[i];
owner &= part.AggregatedInnerOwnerPerms;
group &= part.AggregatedInnerGroupPerms;
everyone &= part.AggregatedInnerEveryonePerms;
if(newObject)
everyone &= part.AggregatedInnerEveryonePerms;
}
// recover modify and move
rootOwnerPerms &= movemodmask;
@ -479,7 +484,7 @@ namespace OpenSim.Region.Framework.Scenes
}
}
public uint GetEffectivePermissions(bool useBase)
public uint CurrentAndFoldedNextPermissions()
{
uint perms=(uint)(PermissionMask.Modify |
PermissionMask.Copy |
@ -487,18 +492,13 @@ namespace OpenSim.Region.Framework.Scenes
PermissionMask.Transfer |
PermissionMask.FoldedMask);
uint ownerMask = 0x7fffffff;
uint ownerMask = RootPart.OwnerMask;
SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
{
SceneObjectPart part = parts[i];
if (useBase)
ownerMask &= part.BaseMask;
else
ownerMask &= part.OwnerMask;
ownerMask &= part.BaseMask;
perms &= part.Inventory.MaskEffectivePermissions();
}