diff options
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 '')
-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 2ce778d..8ddaa60 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -418,18 +418,57 @@ namespace OpenSim.Region.Framework.Scenes | |||
418 | 418 | ||
419 | if (itemUpd.NextPermissions != 0) // Use this to determine validity. Can never be 0 if valid | 419 | if (itemUpd.NextPermissions != 0) // Use this to determine validity. Can never be 0 if valid |
420 | { | 420 | { |
421 | // Create a set of base permissions that will not include export if the user | ||
422 | // is not allowed to change the export flag. | ||
423 | bool denyExportChange = false; | ||
424 | |||
425 | m_log.InfoFormat("[XXX]: B: {0} O: {1} E: {2}", itemUpd.BasePermissions, itemUpd.CurrentPermissions, itemUpd.EveryOnePermissions); | ||
426 | |||
427 | // If the user is not the creator or doesn't have "E" in both "B" and "O", deny setting export | ||
428 | if ((item.BasePermissions & (uint)(PermissionMask.All | PermissionMask.Export)) != (uint)(PermissionMask.All | PermissionMask.Export) || (item.CurrentPermissions & (uint)PermissionMask.Export) == 0 || item.CreatorIdAsUuid != item.Owner) | ||
429 | denyExportChange = true; | ||
430 | |||
431 | m_log.InfoFormat("[XXX]: Deny Export Update {0}", denyExportChange); | ||
432 | |||
433 | // If it is already set, force it set and also force full perm | ||
434 | // else prevent setting it. It can and should never be set unless | ||
435 | // set in base, so the condition above is valid | ||
436 | if (denyExportChange) | ||
437 | { | ||
438 | // If we are not allowed to change it, then force it to the | ||
439 | // original item's setting and if it was on, also force full perm | ||
440 | if ((item.EveryOnePermissions & (uint)PermissionMask.Export) != 0) | ||
441 | { | ||
442 | itemUpd.NextPermissions = (uint)(PermissionMask.All); | ||
443 | itemUpd.EveryOnePermissions |= (uint)PermissionMask.Export; | ||
444 | } | ||
445 | else | ||
446 | { | ||
447 | itemUpd.EveryOnePermissions &= ~(uint)PermissionMask.Export; | ||
448 | } | ||
449 | } | ||
450 | else | ||
451 | { | ||
452 | // If the new state is exportable, force full perm | ||
453 | if ((itemUpd.EveryOnePermissions & (uint)PermissionMask.Export) != 0) | ||
454 | { | ||
455 | m_log.InfoFormat("[XXX]: Force full perm"); | ||
456 | itemUpd.NextPermissions = (uint)(PermissionMask.All); | ||
457 | } | ||
458 | } | ||
459 | |||
421 | if (item.NextPermissions != (itemUpd.NextPermissions & item.BasePermissions)) | 460 | if (item.NextPermissions != (itemUpd.NextPermissions & item.BasePermissions)) |
422 | item.Flags |= (uint)InventoryItemFlags.ObjectOverwriteNextOwner; | 461 | item.Flags |= (uint)InventoryItemFlags.ObjectOverwriteNextOwner; |
423 | item.NextPermissions = itemUpd.NextPermissions & item.BasePermissions; | 462 | item.NextPermissions = itemUpd.NextPermissions & item.BasePermissions; |
463 | |||
424 | if (item.EveryOnePermissions != (itemUpd.EveryOnePermissions & item.BasePermissions)) | 464 | if (item.EveryOnePermissions != (itemUpd.EveryOnePermissions & item.BasePermissions)) |
425 | item.Flags |= (uint)InventoryItemFlags.ObjectOverwriteEveryone; | 465 | item.Flags |= (uint)InventoryItemFlags.ObjectOverwriteEveryone; |
426 | item.EveryOnePermissions = itemUpd.EveryOnePermissions & item.BasePermissions; | 466 | item.EveryOnePermissions = itemUpd.EveryOnePermissions & item.BasePermissions; |
467 | |||
427 | if (item.GroupPermissions != (itemUpd.GroupPermissions & item.BasePermissions)) | 468 | if (item.GroupPermissions != (itemUpd.GroupPermissions & item.BasePermissions)) |
428 | item.Flags |= (uint)InventoryItemFlags.ObjectOverwriteGroup; | 469 | item.Flags |= (uint)InventoryItemFlags.ObjectOverwriteGroup; |
429 | |||
430 | // m_log.DebugFormat("[USER INVENTORY]: item.Flags {0}", item.Flags); | ||
431 | |||
432 | item.GroupPermissions = itemUpd.GroupPermissions & item.BasePermissions; | 470 | item.GroupPermissions = itemUpd.GroupPermissions & item.BasePermissions; |
471 | |||
433 | item.GroupID = itemUpd.GroupID; | 472 | item.GroupID = itemUpd.GroupID; |
434 | item.GroupOwned = itemUpd.GroupOwned; | 473 | item.GroupOwned = itemUpd.GroupOwned; |
435 | item.CreationDate = itemUpd.CreationDate; | 474 | item.CreationDate = itemUpd.CreationDate; |
@@ -451,6 +490,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
451 | item.SaleType = itemUpd.SaleType; | 490 | item.SaleType = itemUpd.SaleType; |
452 | 491 | ||
453 | InventoryService.UpdateItem(item); | 492 | InventoryService.UpdateItem(item); |
493 | remoteClient.SendBulkUpdateInventory(item); | ||
454 | } | 494 | } |
455 | 495 | ||
456 | if (UUID.Zero != transactionID) | 496 | if (UUID.Zero != transactionID) |