aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie Thielker2010-07-14 16:21:55 +0200
committerMelanie Thielker2010-07-14 16:21:55 +0200
commitcbb3a8ab94f8df6963f8045a3ca3795bcbcfe0b5 (patch)
treeaa129914ac25904270f5422b5eb2e8f80e45feec
parentRemove getting the object capacity from the money module. It is now set (diff)
downloadopensim-SC_OLD-cbb3a8ab94f8df6963f8045a3ca3795bcbcfe0b5.zip
opensim-SC_OLD-cbb3a8ab94f8df6963f8045a3ca3795bcbcfe0b5.tar.gz
opensim-SC_OLD-cbb3a8ab94f8df6963f8045a3ca3795bcbcfe0b5.tar.bz2
opensim-SC_OLD-cbb3a8ab94f8df6963f8045a3ca3795bcbcfe0b5.tar.xz
Fix a permissions issue
-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 5796194..e972382 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -447,10 +447,6 @@ namespace OpenSim.Region.Framework.Scenes
447 (uint)PermissionMask.Move; 447 (uint)PermissionMask.Move;
448 uint ownerPerms = item.CurrentPermissions; 448 uint ownerPerms = item.CurrentPermissions;
449 449
450 // Mask the base permissions. This is a conservative
451 // approach altering only the three main perms
452 basePerms &= nextPerms;
453
454 // If this is an object, root prim perms may be more 450 // If this is an object, root prim perms may be more
455 // permissive than folded perms. Use folded perms as 451 // permissive than folded perms. Use folded perms as
456 // a mask 452 // a mask
@@ -466,10 +462,17 @@ namespace OpenSim.Region.Framework.Scenes
466 462
467 // Mask the owner perms to the folded perms 463 // Mask the owner perms to the folded perms
468 ownerPerms &= foldedPerms; 464 ownerPerms &= foldedPerms;
465 basePerms &= foldedPerms;
469 466
470 // If the root was mod, let the mask reflect that 467 // If the root was mod, let the mask reflect that
468 // We also need to adjust the base here, because
469 // we should be able to edit in-inventory perms
470 // for the root prim, if it's mod.
471 if (isRootMod) 471 if (isRootMod)
472 {
472 ownerPerms |= (uint)PermissionMask.Modify; 473 ownerPerms |= (uint)PermissionMask.Modify;
474 basePerms |= (uint)PermissionMask.Modify;
475 }
473 } 476 }
474 477
475 // These will be applied to the root prim at next rez. 478 // These will be applied to the root prim at next rez.
@@ -477,6 +480,10 @@ namespace OpenSim.Region.Framework.Scenes
477 // are preserved due to the above mangling 480 // are preserved due to the above mangling
478 ownerPerms &= nextPerms; 481 ownerPerms &= nextPerms;
479 482
483 // Mask the base permissions. This is a conservative
484 // approach altering only the three main perms
485 basePerms &= nextPerms;
486
480 // Assign to the actual item. Make sure the slam bit is 487 // Assign to the actual item. Make sure the slam bit is
481 // set, if it wasn't set before. 488 // set, if it wasn't set before.
482 itemCopy.BasePermissions = basePerms; 489 itemCopy.BasePermissions = basePerms;
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
index 70b37fb..abb4de6 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
@@ -280,7 +280,7 @@ namespace OpenSim.Region.Framework.Scenes
280 PermissionMask.Move | 280 PermissionMask.Move |
281 PermissionMask.Transfer) | 7; 281 PermissionMask.Transfer) | 7;
282 282
283 uint ownerMask = 0x7ffffff; 283 uint ownerMask = 0x7fffffff;
284 foreach (SceneObjectPart part in m_parts.Values) 284 foreach (SceneObjectPart part in m_parts.Values)
285 { 285 {
286 ownerMask &= part.OwnerMask; 286 ownerMask &= part.OwnerMask;
@@ -294,12 +294,16 @@ namespace OpenSim.Region.Framework.Scenes
294 if ((ownerMask & (uint)PermissionMask.Transfer) == 0) 294 if ((ownerMask & (uint)PermissionMask.Transfer) == 0)
295 perms &= ~(uint)PermissionMask.Transfer; 295 perms &= ~(uint)PermissionMask.Transfer;
296 296
297 if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Modify) == 0) 297 // If root prim permissions are applied here, this would screw
298 perms &= ~((uint)PermissionMask.Modify >> 13); 298 // with in-inventory manipulation of the next owner perms
299 if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Copy) == 0) 299 // in a major way. So, let's move this to the give itself.
300 perms &= ~((uint)PermissionMask.Copy >> 13); 300 // Yes. I know. Evil.
301 if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Transfer) == 0) 301// if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Modify) == 0)
302 perms &= ~((uint)PermissionMask.Transfer >> 13); 302// perms &= ~((uint)PermissionMask.Modify >> 13);
303// if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Copy) == 0)
304// perms &= ~((uint)PermissionMask.Copy >> 13);
305// if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Transfer) == 0)
306// perms &= ~((uint)PermissionMask.Transfer >> 13);
303 307
304 return perms; 308 return perms;
305 } 309 }