From 46caea6987a24e07f61e3c3bef24ab4495899bda Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 26 Sep 2014 15:03:33 +0100 Subject: change it again... --- OpenSim/Framework/AnimationSet.cs | 47 +++++++++++++++++----- .../Linden/Caps/BunchOfCaps/BunchOfCaps.cs | 2 +- 2 files changed, 37 insertions(+), 12 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/AnimationSet.cs b/OpenSim/Framework/AnimationSet.cs index 7e6aa17..1743376 100644 --- a/OpenSim/Framework/AnimationSet.cs +++ b/OpenSim/Framework/AnimationSet.cs @@ -33,30 +33,55 @@ namespace OpenSim.Framework { public delegate bool AnimationSetValidator(UUID animID); - public class AnimationSet { private readonly int m_maxAnimations = 255; - public const uint allowedPermitions = (uint)(PermissionMask.Copy | PermissionMask.Modify); + public const uint createBasePermitions = (uint)(PermissionMask.Copy | PermissionMask.Modify); + public const uint createNextPermitions = (uint)PermissionMask.Modify; + + public const uint allowedBasePermitions = (uint)(PermissionMask.Copy | PermissionMask.Modify); + public const uint allowedNextPermitions = (uint)PermissionMask.Modify; - public static uint enforcePermition(uint currentPerm) + public static void setCreateItemPermitions(InventoryItemBase it) { - return currentPerm & allowedPermitions; + if (it == null) + return; + + it.BasePermissions = createBasePermitions; + it.CurrentPermissions = createBasePermitions; + // it.GroupPermissions &= allowedPermitions; + it.NextPermissions = createNextPermitions; + // it.EveryOnePermissions &= allowedPermitions; + it.GroupPermissions = 0; + it.EveryOnePermissions = 0; } - public static void enforceItemPermitions(InventoryItemBase it) + public static void enforceItemPermitions(InventoryItemBase it, bool IsCreator) { if (it == null) return; - it.BasePermissions &= allowedPermitions; - it.CurrentPermissions &= allowedPermitions; -// it.GroupPermissions &= allowedPermitions; -// it.NextPermissions &= allowedPermitions; -// it.EveryOnePermissions &= allowedPermitions; + uint bp; + uint np; + + if (IsCreator) + { + bp = createBasePermitions; + np = createNextPermitions; + } + else + { + bp = allowedBasePermitions; + np = allowedNextPermitions; + } + + it.BasePermissions &= bp; + it.CurrentPermissions &= bp; + // it.GroupPermissions &= allowedPermitions; + it.NextPermissions &= np; + // it.EveryOnePermissions &= allowedPermitions; it.GroupPermissions = 0; - it.NextPermissions = 0; it.EveryOnePermissions = 0; } diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs index 1e28db0..75634e0 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs @@ -1125,7 +1125,7 @@ namespace OpenSim.Region.ClientStack.Linden if (inType == (sbyte)CustomInventoryType.AnimationSet) { - AnimationSet.enforceItemPermitions(item); + AnimationSet.setCreateItemPermitions(item); } else if (restrictPerms) -- cgit v1.1