aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs15
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs18
2 files changed, 22 insertions, 11 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 34461dc..2578685 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -432,10 +432,6 @@ namespace OpenSim.Region.Framework.Scenes
432 (uint)PermissionMask.Move; 432 (uint)PermissionMask.Move;
433 uint ownerPerms = item.CurrentPermissions; 433 uint ownerPerms = item.CurrentPermissions;
434 434
435 // Mask the base permissions. This is a conservative
436 // approach altering only the three main perms
437 basePerms &= nextPerms;
438
439 // If this is an object, root prim perms may be more 435 // If this is an object, root prim perms may be more
440 // permissive than folded perms. Use folded perms as 436 // permissive than folded perms. Use folded perms as
441 // a mask 437 // a mask
@@ -451,10 +447,17 @@ namespace OpenSim.Region.Framework.Scenes
451 447
452 // Mask the owner perms to the folded perms 448 // Mask the owner perms to the folded perms
453 ownerPerms &= foldedPerms; 449 ownerPerms &= foldedPerms;
450 basePerms &= foldedPerms;
454 451
455 // If the root was mod, let the mask reflect that 452 // If the root was mod, let the mask reflect that
453 // We also need to adjust the base here, because
454 // we should be able to edit in-inventory perms
455 // for the root prim, if it's mod.
456 if (isRootMod) 456 if (isRootMod)
457 {
457 ownerPerms |= (uint)PermissionMask.Modify; 458 ownerPerms |= (uint)PermissionMask.Modify;
459 basePerms |= (uint)PermissionMask.Modify;
460 }
458 } 461 }
459 462
460 // These will be applied to the root prim at next rez. 463 // These will be applied to the root prim at next rez.
@@ -462,6 +465,10 @@ namespace OpenSim.Region.Framework.Scenes
462 // are preserved due to the above mangling 465 // are preserved due to the above mangling
463 ownerPerms &= nextPerms; 466 ownerPerms &= nextPerms;
464 467
468 // Mask the base permissions. This is a conservative
469 // approach altering only the three main perms
470 basePerms &= nextPerms;
471
465 // Assign to the actual item. Make sure the slam bit is 472 // Assign to the actual item. Make sure the slam bit is
466 // set, if it wasn't set before. 473 // set, if it wasn't set before.
467 itemCopy.BasePermissions = basePerms; 474 itemCopy.BasePermissions = basePerms;
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
index 55d2e32..9a01a28 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
@@ -282,7 +282,7 @@ namespace OpenSim.Region.Framework.Scenes
282 PermissionMask.Move | 282 PermissionMask.Move |
283 PermissionMask.Transfer) | 7; 283 PermissionMask.Transfer) | 7;
284 284
285 uint ownerMask = 0x7ffffff; 285 uint ownerMask = 0x7fffffff;
286 foreach (SceneObjectPart part in m_parts.Values) 286 foreach (SceneObjectPart part in m_parts.Values)
287 { 287 {
288 ownerMask &= part.OwnerMask; 288 ownerMask &= part.OwnerMask;
@@ -296,12 +296,16 @@ namespace OpenSim.Region.Framework.Scenes
296 if ((ownerMask & (uint)PermissionMask.Transfer) == 0) 296 if ((ownerMask & (uint)PermissionMask.Transfer) == 0)
297 perms &= ~(uint)PermissionMask.Transfer; 297 perms &= ~(uint)PermissionMask.Transfer;
298 298
299 if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Modify) == 0) 299 // If root prim permissions are applied here, this would screw
300 perms &= ~((uint)PermissionMask.Modify >> 13); 300 // with in-inventory manipulation of the next owner perms
301 if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Copy) == 0) 301 // in a major way. So, let's move this to the give itself.
302 perms &= ~((uint)PermissionMask.Copy >> 13); 302 // Yes. I know. Evil.
303 if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Transfer) == 0) 303// if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Modify) == 0)
304 perms &= ~((uint)PermissionMask.Transfer >> 13); 304// perms &= ~((uint)PermissionMask.Modify >> 13);
305// if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Copy) == 0)
306// perms &= ~((uint)PermissionMask.Copy >> 13);
307// if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Transfer) == 0)
308// perms &= ~((uint)PermissionMask.Transfer >> 13);
305 309
306 return perms; 310 return perms;
307 } 311 }