diff options
author | Melanie | 2013-03-31 20:25:32 +0200 |
---|---|---|
committer | Melanie | 2013-03-31 20:25:32 +0200 |
commit | 4bf9c4bbb833f8ecbd0757b333da76ffaea14bc7 (patch) | |
tree | 6bbbfe887569aa4caff878e61fb18b66875c86f7 /OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |
parent | Phase 1 of implementing a transfer permission. Overwrite libOMV's PermissionMask (diff) | |
download | opensim-SC-4bf9c4bbb833f8ecbd0757b333da76ffaea14bc7.zip opensim-SC-4bf9c4bbb833f8ecbd0757b333da76ffaea14bc7.tar.gz opensim-SC-4bf9c4bbb833f8ecbd0757b333da76ffaea14bc7.tar.bz2 opensim-SC-4bf9c4bbb833f8ecbd0757b333da76ffaea14bc7.tar.xz |
Export permission, part two. Setting export perms for textures and clothing works. Setting perms for prims also works but they don't propagate correctly yet.
NOT FOR PRODUCTIN USE. Your database will need to be updated before you can use this!
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 46 |
1 files changed, 43 insertions, 3 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) |