aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs46
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs29
3 files changed, 66 insertions, 11 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 6a3fb24..d2e41f8 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -413,18 +413,57 @@ namespace OpenSim.Region.Framework.Scenes
413 413
414 if (itemUpd.NextPermissions != 0) // Use this to determine validity. Can never be 0 if valid 414 if (itemUpd.NextPermissions != 0) // Use this to determine validity. Can never be 0 if valid
415 { 415 {
416 // Create a set of base permissions that will not include export if the user
417 // is not allowed to change the export flag.
418 bool denyExportChange = false;
419
420 m_log.InfoFormat("[XXX]: B: {0} O: {1} E: {2}", itemUpd.BasePermissions, itemUpd.CurrentPermissions, itemUpd.EveryOnePermissions);
421
422 // If the user is not the creator or doesn't have "E" in both "B" and "O", deny setting export
423 if ((item.BasePermissions & (uint)(PermissionMask.All | PermissionMask.Export)) != (uint)(PermissionMask.All | PermissionMask.Export) || (item.CurrentPermissions & (uint)PermissionMask.Export) == 0 || item.CreatorIdAsUuid != item.Owner)
424 denyExportChange = true;
425
426 m_log.InfoFormat("[XXX]: Deny Export Update {0}", denyExportChange);
427
428 // If it is already set, force it set and also force full perm
429 // else prevent setting it. It can and should never be set unless
430 // set in base, so the condition above is valid
431 if (denyExportChange)
432 {
433 // If we are not allowed to change it, then force it to the
434 // original item's setting and if it was on, also force full perm
435 if ((item.EveryOnePermissions & (uint)PermissionMask.Export) != 0)
436 {
437 itemUpd.NextPermissions = (uint)(PermissionMask.All);
438 itemUpd.EveryOnePermissions |= (uint)PermissionMask.Export;
439 }
440 else
441 {
442 itemUpd.EveryOnePermissions &= ~(uint)PermissionMask.Export;
443 }
444 }
445 else
446 {
447 // If the new state is exportable, force full perm
448 if ((itemUpd.EveryOnePermissions & (uint)PermissionMask.Export) != 0)
449 {
450 m_log.InfoFormat("[XXX]: Force full perm");
451 itemUpd.NextPermissions = (uint)(PermissionMask.All);
452 }
453 }
454
416 if (item.NextPermissions != (itemUpd.NextPermissions & item.BasePermissions)) 455 if (item.NextPermissions != (itemUpd.NextPermissions & item.BasePermissions))
417 item.Flags |= (uint)InventoryItemFlags.ObjectOverwriteNextOwner; 456 item.Flags |= (uint)InventoryItemFlags.ObjectOverwriteNextOwner;
418 item.NextPermissions = itemUpd.NextPermissions & item.BasePermissions; 457 item.NextPermissions = itemUpd.NextPermissions & item.BasePermissions;
458
419 if (item.EveryOnePermissions != (itemUpd.EveryOnePermissions & item.BasePermissions)) 459 if (item.EveryOnePermissions != (itemUpd.EveryOnePermissions & item.BasePermissions))
420 item.Flags |= (uint)InventoryItemFlags.ObjectOverwriteEveryone; 460 item.Flags |= (uint)InventoryItemFlags.ObjectOverwriteEveryone;
421 item.EveryOnePermissions = itemUpd.EveryOnePermissions & item.BasePermissions; 461 item.EveryOnePermissions = itemUpd.EveryOnePermissions & item.BasePermissions;
462
422 if (item.GroupPermissions != (itemUpd.GroupPermissions & item.BasePermissions)) 463 if (item.GroupPermissions != (itemUpd.GroupPermissions & item.BasePermissions))
423 item.Flags |= (uint)InventoryItemFlags.ObjectOverwriteGroup; 464 item.Flags |= (uint)InventoryItemFlags.ObjectOverwriteGroup;
424
425// m_log.DebugFormat("[USER INVENTORY]: item.Flags {0}", item.Flags);
426
427 item.GroupPermissions = itemUpd.GroupPermissions & item.BasePermissions; 465 item.GroupPermissions = itemUpd.GroupPermissions & item.BasePermissions;
466
428 item.GroupID = itemUpd.GroupID; 467 item.GroupID = itemUpd.GroupID;
429 item.GroupOwned = itemUpd.GroupOwned; 468 item.GroupOwned = itemUpd.GroupOwned;
430 item.CreationDate = itemUpd.CreationDate; 469 item.CreationDate = itemUpd.CreationDate;
@@ -446,6 +485,7 @@ namespace OpenSim.Region.Framework.Scenes
446 item.SaleType = itemUpd.SaleType; 485 item.SaleType = itemUpd.SaleType;
447 486
448 InventoryService.UpdateItem(item); 487 InventoryService.UpdateItem(item);
488 remoteClient.SendBulkUpdateInventory(item);
449 } 489 }
450 490
451 if (UUID.Zero != transactionID) 491 if (UUID.Zero != transactionID)
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index b109b4f..69fb6df 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3468,7 +3468,7 @@ namespace OpenSim.Region.Framework.Scenes
3468 3468
3469 public void AdjustChildPrimPermissions() 3469 public void AdjustChildPrimPermissions()
3470 { 3470 {
3471 uint newOwnerMask = (uint)PermissionMask.All & 0xfffffff8; // Mask folded bits 3471 uint newOwnerMask = (uint)(PermissionMask.All | PermissionMask.Export) & 0xfffffff8; // Mask folded bits
3472 uint foldedPerms = RootPart.OwnerMask & 3; 3472 uint foldedPerms = RootPart.OwnerMask & 3;
3473 3473
3474 ForEachPart(part => 3474 ForEachPart(part =>
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 6839614..42644dc 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -470,8 +470,8 @@ namespace OpenSim.Region.Framework.Scenes
470 private uint _category; 470 private uint _category;
471 private Int32 _creationDate; 471 private Int32 _creationDate;
472 private uint _parentID = 0; 472 private uint _parentID = 0;
473 private uint _baseMask = (uint)PermissionMask.All; 473 private uint _baseMask = (uint)(PermissionMask.All | PermissionMask.Export);
474 private uint _ownerMask = (uint)PermissionMask.All; 474 private uint _ownerMask = (uint)(PermissionMask.All | PermissionMask.Export);
475 private uint _groupMask = (uint)PermissionMask.None; 475 private uint _groupMask = (uint)PermissionMask.None;
476 private uint _everyoneMask = (uint)PermissionMask.None; 476 private uint _everyoneMask = (uint)PermissionMask.None;
477 private uint _nextOwnerMask = (uint)(PermissionMask.Move | PermissionMask.Modify | PermissionMask.Transfer); 477 private uint _nextOwnerMask = (uint)(PermissionMask.Move | PermissionMask.Modify | PermissionMask.Transfer);
@@ -4323,10 +4323,10 @@ namespace OpenSim.Region.Framework.Scenes
4323 4323
4324 public void TrimPermissions() 4324 public void TrimPermissions()
4325 { 4325 {
4326 BaseMask &= (uint)PermissionMask.All; 4326 BaseMask &= (uint)(PermissionMask.All | PermissionMask.Export);
4327 OwnerMask &= (uint)PermissionMask.All; 4327 OwnerMask &= (uint)(PermissionMask.All | PermissionMask.Export);
4328 GroupMask &= (uint)PermissionMask.All; 4328 GroupMask &= (uint)PermissionMask.All;
4329 EveryoneMask &= (uint)PermissionMask.All; 4329 EveryoneMask &= (uint)(PermissionMask.All | PermissionMask.Export);
4330 NextOwnerMask &= (uint)PermissionMask.All; 4330 NextOwnerMask &= (uint)PermissionMask.All;
4331 } 4331 }
4332 4332
@@ -4429,10 +4429,22 @@ namespace OpenSim.Region.Framework.Scenes
4429 baseMask; 4429 baseMask;
4430 break; 4430 break;
4431 case 8: 4431 case 8:
4432 // Trying to set export permissions - extra checks
4433 if (set && (mask & (uint)PermissionMask.Export) != 0)
4434 {
4435 if ((OwnerMask & (uint)PermissionMask.Export) == 0 || (BaseMask & (uint)PermissionMask.Export) == 0 || (NextOwnerMask & (uint)PermissionMask.All) != (uint)PermissionMask.All)
4436 mask &= ~(uint)PermissionMask.Export;
4437 }
4432 EveryoneMask = ApplyMask(EveryoneMask, set, mask) & 4438 EveryoneMask = ApplyMask(EveryoneMask, set, mask) &
4433 baseMask; 4439 baseMask;
4434 break; 4440 break;
4435 case 16: 4441 case 16:
4442 // Force full perm if export
4443 if ((EveryoneMask & (uint)PermissionMask.Export) != 0)
4444 {
4445 NextOwnerMask = (uint)PermissionMask.All;
4446 break;
4447 }
4436 NextOwnerMask = ApplyMask(NextOwnerMask, set, mask) & 4448 NextOwnerMask = ApplyMask(NextOwnerMask, set, mask) &
4437 baseMask; 4449 baseMask;
4438 // Prevent the client from creating no copy, no transfer 4450 // Prevent the client from creating no copy, no transfer
@@ -5229,9 +5241,12 @@ namespace OpenSim.Region.Framework.Scenes
5229 5241
5230 public void ApplyNextOwnerPermissions() 5242 public void ApplyNextOwnerPermissions()
5231 { 5243 {
5232 BaseMask &= NextOwnerMask; 5244 // Export needs to be preserved in the base and everyone
5245 // mask, but removed in the owner mask as a next owner
5246 // can never change the export status
5247 BaseMask &= NextOwnerMask | (uint)PermissionMask.Export;
5233 OwnerMask &= NextOwnerMask; 5248 OwnerMask &= NextOwnerMask;
5234 EveryoneMask &= NextOwnerMask; 5249 EveryoneMask &= NextOwnerMask | (uint)PermissionMask.Export;
5235 5250
5236 Inventory.ApplyNextOwnerPermissions(); 5251 Inventory.ApplyNextOwnerPermissions();
5237 } 5252 }