diff options
Diffstat (limited to '')
-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 5851ec6..ce9baaa 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -5293,6 +5293,64 @@ namespace OpenSim.Region.Framework.Scenes | |||
5293 | { | 5293 | { |
5294 | ParentGroup.AddScriptLPS(count); | 5294 | ParentGroup.AddScriptLPS(count); |
5295 | } | 5295 | } |
5296 | |||
5297 | /// <summary> | ||
5298 | /// Sets a prim's owner and permissions when it's rezzed. | ||
5299 | /// </summary> | ||
5300 | /// <param name="item">The inventory item from which the item was rezzed</param> | ||
5301 | /// <param name="userInventory">True: the item is being rezzed from the user's inventory. False: from a prim's inventory.</param> | ||
5302 | /// <param name="scene">The scene the prim is being rezzed into</param> | ||
5303 | public void ApplyPermissionsOnRez(InventoryItemBase item, bool userInventory, Scene scene) | ||
5304 | { | ||
5305 | if ((OwnerID != item.Owner) || ((item.CurrentPermissions & SceneObjectGroup.SLAM) != 0) || ((item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0)) | ||
5306 | { | ||
5307 | if (scene.Permissions.PropagatePermissions()) | ||
5308 | { | ||
5309 | if ((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0) | ||
5310 | { | ||
5311 | // Apply the item's permissions to the object | ||
5312 | //LogPermissions("Before applying item permissions"); | ||
5313 | if (userInventory) | ||
5314 | { | ||
5315 | EveryoneMask = item.EveryOnePermissions; | ||
5316 | NextOwnerMask = item.NextPermissions; | ||
5317 | } | ||
5318 | else | ||
5319 | { | ||
5320 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0) | ||
5321 | EveryoneMask = item.EveryOnePermissions; | ||
5322 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0) | ||
5323 | NextOwnerMask = item.NextPermissions; | ||
5324 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteGroup) != 0) | ||
5325 | GroupMask = item.GroupPermissions; | ||
5326 | } | ||
5327 | //LogPermissions("After applying item permissions"); | ||
5328 | } | ||
5329 | } | ||
5330 | |||
5331 | GroupMask = 0; // DO NOT propagate here | ||
5332 | } | ||
5333 | |||
5334 | if (OwnerID != item.Owner) | ||
5335 | { | ||
5336 | //LogPermissions("Before ApplyNextOwnerPermissions"); | ||
5337 | ApplyNextOwnerPermissions(); | ||
5338 | //LogPermissions("After ApplyNextOwnerPermissions"); | ||
5339 | |||
5340 | LastOwnerID = OwnerID; | ||
5341 | OwnerID = item.Owner; | ||
5342 | Inventory.ChangeInventoryOwner(item.Owner); | ||
5343 | } | ||
5344 | } | ||
5345 | |||
5346 | /// <summary> | ||
5347 | /// Logs the prim's permissions. Useful when debugging permission problems. | ||
5348 | /// </summary> | ||
5349 | /// <param name="message"></param> | ||
5350 | private void LogPermissions(String message) | ||
5351 | { | ||
5352 | PermissionsUtil.LogPermissions(Name, message, BaseMask, OwnerMask, NextOwnerMask); | ||
5353 | } | ||
5296 | 5354 | ||
5297 | public void ApplyNextOwnerPermissions() | 5355 | public void ApplyNextOwnerPermissions() |
5298 | { | 5356 | { |