aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorOren Hurvitz2013-11-07 17:25:39 +0200
committerJustin Clark-Casey (justincc)2014-01-10 20:01:08 +0000
commit88f01a41305364e0d505964c6743d95d1564530b (patch)
tree6a18abc03541d3cf2f8636c606128227affcf1da
parentWhen creating a coalesced object, set its Creator ID if all the objects have ... (diff)
downloadopensim-SC-88f01a41305364e0d505964c6743d95d1564530b.zip
opensim-SC-88f01a41305364e0d505964c6743d95d1564530b.tar.gz
opensim-SC-88f01a41305364e0d505964c6743d95d1564530b.tar.bz2
opensim-SC-88f01a41305364e0d505964c6743d95d1564530b.tar.xz
When creating a coalesced object, set its permissions to the lowest-common-denominator of all the sub-objects
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs23
1 files changed, 16 insertions, 7 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index af95577..781cc69 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -502,8 +502,17 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
502 IClientAPI remoteClient) 502 IClientAPI remoteClient)
503 { 503 {
504 uint effectivePerms = (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify | PermissionMask.Move | PermissionMask.Export) | 7; 504 uint effectivePerms = (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify | PermissionMask.Move | PermissionMask.Export) | 7;
505 uint allObjectsNextOwnerPerms = 0x7fffffff;
506 uint allObjectsEveryOnePerms = 0x7fffffff;
507 uint allObjectsGroupPerms = 0x7fffffff;
508
505 foreach (SceneObjectGroup grp in objsForEffectivePermissions) 509 foreach (SceneObjectGroup grp in objsForEffectivePermissions)
510 {
506 effectivePerms &= grp.GetEffectivePermissions(); 511 effectivePerms &= grp.GetEffectivePermissions();
512 allObjectsNextOwnerPerms &= grp.RootPart.NextOwnerMask;
513 allObjectsEveryOnePerms &= grp.RootPart.EveryoneMask;
514 allObjectsGroupPerms &= grp.RootPart.GroupMask;
515 }
507 effectivePerms |= (uint)PermissionMask.Move; 516 effectivePerms |= (uint)PermissionMask.Move;
508 517
509 //PermissionsUtil.LogPermissions(item.Name, "Before AddPermissions", item.BasePermissions, item.CurrentPermissions, item.NextPermissions); 518 //PermissionsUtil.LogPermissions(item.Name, "Before AddPermissions", item.BasePermissions, item.CurrentPermissions, item.NextPermissions);
@@ -513,11 +522,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
513 uint perms = effectivePerms; 522 uint perms = effectivePerms;
514 PermissionsUtil.ApplyFoldedPermissions(effectivePerms, ref perms); 523 PermissionsUtil.ApplyFoldedPermissions(effectivePerms, ref perms);
515 524
516 item.BasePermissions = perms & so.RootPart.NextOwnerMask; 525 item.BasePermissions = perms & allObjectsNextOwnerPerms;
517 item.CurrentPermissions = item.BasePermissions; 526 item.CurrentPermissions = item.BasePermissions;
518 item.NextPermissions = perms & so.RootPart.NextOwnerMask; 527 item.NextPermissions = perms & allObjectsNextOwnerPerms;
519 item.EveryOnePermissions = so.RootPart.EveryoneMask & so.RootPart.NextOwnerMask; 528 item.EveryOnePermissions = allObjectsEveryOnePerms & allObjectsNextOwnerPerms;
520 item.GroupPermissions = so.RootPart.GroupMask & so.RootPart.NextOwnerMask; 529 item.GroupPermissions = allObjectsGroupPerms & allObjectsNextOwnerPerms;
521 530
522 // apply next owner perms on rez 531 // apply next owner perms on rez
523 item.CurrentPermissions |= SceneObjectGroup.SLAM; 532 item.CurrentPermissions |= SceneObjectGroup.SLAM;
@@ -526,9 +535,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
526 { 535 {
527 item.BasePermissions = effectivePerms; 536 item.BasePermissions = effectivePerms;
528 item.CurrentPermissions = effectivePerms; 537 item.CurrentPermissions = effectivePerms;
529 item.NextPermissions = so.RootPart.NextOwnerMask & effectivePerms; 538 item.NextPermissions = allObjectsNextOwnerPerms & effectivePerms;
530 item.EveryOnePermissions = so.RootPart.EveryoneMask & effectivePerms; 539 item.EveryOnePermissions = allObjectsEveryOnePerms & effectivePerms;
531 item.GroupPermissions = so.RootPart.GroupMask & effectivePerms; 540 item.GroupPermissions = allObjectsGroupPerms & effectivePerms;
532 541
533 item.CurrentPermissions &= 542 item.CurrentPermissions &=
534 ((uint)PermissionMask.Copy | 543 ((uint)PermissionMask.Copy |