From 6735d3496cb93c68011ae5e0e45e0b73b5e729d8 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 16 Jan 2017 19:49:07 +0000 Subject: [PATCH] fix EffectiveGroupOrEveryOnePerms C&T == 0 case --- .../Scenes/SceneObjectGroup.Inventory.cs | 32 ++++++++++++++++--- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs index 7b9ea8b7f4..399e3412a0 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs @@ -277,6 +277,7 @@ namespace OpenSim.Region.Framework.Scenes } } + private uint m_EffectiveGroupOrEveryOnePerms; public uint EffectiveGroupOrEveryOnePerms { get @@ -285,7 +286,7 @@ namespace OpenSim.Region.Framework.Scenes // bc this is on heavy duty code paths // but for now we need to test the concept AggregateDeepPerms(); - return m_EffectiveEveryOnePerms | m_EffectiveGroupPerms; + return m_EffectiveGroupOrEveryOnePerms; } } @@ -339,18 +340,28 @@ namespace OpenSim.Region.Framework.Scenes // recover modify and move baseGroupPerms &= movemodmask; group |= baseGroupPerms; + group &= allmask; + + uint groupOrEveryone = group; + if((group & copytransfermast) == 0) group |= (uint)PermissionMask.Transfer; - group &= allmask; m_EffectiveGroupPerms = group; // recover move baseEveryonePerms &= (uint)PermissionMask.Move; everyone |= baseEveryonePerms; + everyone &= allmask; + + groupOrEveryone |= everyone; + if((everyone & copytransfermast) == 0) // not much sense but as sl everyone |= (uint)PermissionMask.Transfer; - everyone &= allmask; m_EffectiveEveryOnePerms = everyone; + + if((groupOrEveryone & copytransfermast) == 0) // not much sense but as sl + groupOrEveryone |= (uint)PermissionMask.Transfer; + m_EffectiveGroupOrEveryOnePerms = groupOrEveryone; } } @@ -375,6 +386,7 @@ namespace OpenSim.Region.Framework.Scenes for (int i = 0; i < parts.Length; i++) { SceneObjectPart part = parts[i]; + part.AggregateInnerPerms(); owner &= part.AggregatedInnerOwnerPerms; group &= part.AggregatedInnerGroupPerms; everyone &= part.AggregatedInnerEveryonePerms; @@ -390,18 +402,28 @@ namespace OpenSim.Region.Framework.Scenes // recover modify and move baseGroupPerms &= movemodmask; group |= baseGroupPerms; + group &= allmask; + + uint groupOrEveryone = group; + if((group & copytransfermast) == 0) group |= (uint)PermissionMask.Transfer; - group &= allmask; m_EffectiveGroupPerms = group; // recover move baseEveryonePerms &= (uint)PermissionMask.Move; everyone |= baseEveryonePerms; + everyone &= allmask; + + groupOrEveryone |= everyone; + if((everyone & copytransfermast) == 0) // not much sense but as sl everyone |= (uint)PermissionMask.Transfer; - everyone &= allmask; m_EffectiveEveryOnePerms = everyone; + + if((groupOrEveryone & copytransfermast) == 0) // not much sense but as sl + groupOrEveryone |= (uint)PermissionMask.Transfer; + m_EffectiveGroupOrEveryOnePerms = groupOrEveryone; } }