diff options
author | Oren Hurvitz | 2013-11-04 19:28:24 +0200 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-01-10 19:37:59 +0000 |
commit | 13f31fdf85c404896c166932730b7b8bc5416626 (patch) | |
tree | 7fc489557e3b3c040b02c185c5ea97bcdf85434d /OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |
parent | If an agent is sitting, then do send the rotation in the agent update instead... (diff) | |
download | opensim-SC-13f31fdf85c404896c166932730b7b8bc5416626.zip opensim-SC-13f31fdf85c404896c166932730b7b8bc5416626.tar.gz opensim-SC-13f31fdf85c404896c166932730b7b8bc5416626.tar.bz2 opensim-SC-13f31fdf85c404896c166932730b7b8bc5416626.tar.xz |
Refactored setting permissions when rezzing items: use the same function when rezzing from user inventory and prim inventory.
Also, fixed a bug: when rezzing a coalesced object from a prim's inventory, apply the coalesced object's name and description only to the first sub-object; not to all the objects in the coalescence. (This was already done correctly when rezzing from a user's inventory.)
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index ea9d0d8..1cf7726 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -4800,6 +4800,64 @@ namespace OpenSim.Region.Framework.Scenes | |||
4800 | { | 4800 | { |
4801 | ParentGroup.AddScriptLPS(count); | 4801 | ParentGroup.AddScriptLPS(count); |
4802 | } | 4802 | } |
4803 | |||
4804 | /// <summary> | ||
4805 | /// Sets a prim's owner and permissions when it's rezzed. | ||
4806 | /// </summary> | ||
4807 | /// <param name="item">The inventory item from which the item was rezzed</param> | ||
4808 | /// <param name="userInventory">True: the item is being rezzed from the user's inventory. False: from a prim's inventory.</param> | ||
4809 | /// <param name="scene">The scene the prim is being rezzed into</param> | ||
4810 | public void ApplyPermissionsOnRez(InventoryItemBase item, bool userInventory, Scene scene) | ||
4811 | { | ||
4812 | if ((OwnerID != item.Owner) || ((item.CurrentPermissions & SceneObjectGroup.SLAM) != 0) || ((item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0)) | ||
4813 | { | ||
4814 | if (scene.Permissions.PropagatePermissions()) | ||
4815 | { | ||
4816 | if ((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0) | ||
4817 | { | ||
4818 | // Apply the item's permissions to the object | ||
4819 | //LogPermissions("Before applying item permissions"); | ||
4820 | if (userInventory) | ||
4821 | { | ||
4822 | EveryoneMask = item.EveryOnePermissions; | ||
4823 | NextOwnerMask = item.NextPermissions; | ||
4824 | } | ||
4825 | else | ||
4826 | { | ||
4827 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0) | ||
4828 | EveryoneMask = item.EveryOnePermissions; | ||
4829 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0) | ||
4830 | NextOwnerMask = item.NextPermissions; | ||
4831 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteGroup) != 0) | ||
4832 | GroupMask = item.GroupPermissions; | ||
4833 | } | ||
4834 | //LogPermissions("After applying item permissions"); | ||
4835 | } | ||
4836 | } | ||
4837 | |||
4838 | GroupMask = 0; // DO NOT propagate here | ||
4839 | } | ||
4840 | |||
4841 | if (OwnerID != item.Owner) | ||
4842 | { | ||
4843 | //LogPermissions("Before ApplyNextOwnerPermissions"); | ||
4844 | ApplyNextOwnerPermissions(); | ||
4845 | //LogPermissions("After ApplyNextOwnerPermissions"); | ||
4846 | |||
4847 | LastOwnerID = OwnerID; | ||
4848 | OwnerID = item.Owner; | ||
4849 | Inventory.ChangeInventoryOwner(item.Owner); | ||
4850 | } | ||
4851 | } | ||
4852 | |||
4853 | /// <summary> | ||
4854 | /// Logs the prim's permissions. Useful when debugging permission problems. | ||
4855 | /// </summary> | ||
4856 | /// <param name="message"></param> | ||
4857 | private void LogPermissions(String message) | ||
4858 | { | ||
4859 | PermissionsUtil.LogPermissions(Name, message, BaseMask, OwnerMask, NextOwnerMask); | ||
4860 | } | ||
4803 | 4861 | ||
4804 | public void ApplyNextOwnerPermissions() | 4862 | public void ApplyNextOwnerPermissions() |
4805 | { | 4863 | { |