aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs13
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs25
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs46
4 files changed, 45 insertions, 43 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 2f016fa..edf8cb6 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -682,19 +682,19 @@ namespace OpenSim.Region.Framework.Scenes
682 // These will be applied to the root prim at next rez. 682 // These will be applied to the root prim at next rez.
683 // The legacy slam bit (bit 3) and folded permission (bits 0-2) 683 // The legacy slam bit (bit 3) and folded permission (bits 0-2)
684 // are preserved due to the above mangling 684 // are preserved due to the above mangling
685 ownerPerms &= nextPerms; 685// ownerPerms &= nextPerms;
686 686
687 // Mask the base permissions. This is a conservative 687 // Mask the base permissions. This is a conservative
688 // approach altering only the three main perms 688 // approach altering only the three main perms
689 basePerms &= nextPerms; 689// basePerms &= nextPerms;
690 690
691 // Mask out the folded portion of the base mask. 691 // Mask out the folded portion of the base mask.
692 // While the owner mask carries the actual folded 692 // While the owner mask carries the actual folded
693 // permissions, the base mask carries the original 693 // permissions, the base mask carries the original
694 // base mask, before masking with the folded perms. 694 // base mask, before masking with the folded perms.
695 // We need this later for rezzing. 695 // We need this later for rezzing.
696 basePerms &= ~(uint)PermissionMask.FoldedMask; 696// basePerms &= ~(uint)PermissionMask.FoldedMask;
697 basePerms |= ((basePerms >> 13) & 7) | (((basePerms & (uint)PermissionMask.Export) != 0) ? (uint)PermissionMask.FoldedExport : 0); 697// basePerms |= ((basePerms >> 13) & 7) | (((basePerms & (uint)PermissionMask.Export) != 0) ? (uint)PermissionMask.FoldedExport : 0);
698 698
699 // If this is an object, root prim perms may be more 699 // If this is an object, root prim perms may be more
700 // permissive than folded perms. Use folded perms as 700 // permissive than folded perms. Use folded perms as
@@ -729,6 +729,11 @@ namespace OpenSim.Region.Framework.Scenes
729 } 729 }
730 } 730 }
731 731
732 // move here so nextperms are mandatory
733 ownerPerms &= nextPerms;
734 basePerms &= nextPerms;
735 basePerms &= ~(uint)PermissionMask.FoldedMask;
736 basePerms |= ((basePerms >> 13) & 7) | (((basePerms & (uint)PermissionMask.Export) != 0) ? (uint)PermissionMask.FoldedExport : 0);
732 // Assign to the actual item. Make sure the slam bit is 737 // Assign to the actual item. Make sure the slam bit is
733 // set, if it wasn't set before. 738 // set, if it wasn't set before.
734 itemCopy.BasePermissions = basePerms; 739 itemCopy.BasePermissions = basePerms;
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
index 081281e..42f47b5 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
@@ -326,7 +326,7 @@ namespace OpenSim.Region.Framework.Scenes
326 // aux 326 // aux
327 const uint allmask = (uint)PermissionMask.AllEffective; 327 const uint allmask = (uint)PermissionMask.AllEffective;
328 const uint movemodmask = (uint)(PermissionMask.Move | PermissionMask.Modify); 328 const uint movemodmask = (uint)(PermissionMask.Move | PermissionMask.Modify);
329 const uint copytransfermast = (uint)(PermissionMask.Copy | PermissionMask.Transfer); 329 const uint copytransfermask = (uint)(PermissionMask.Copy | PermissionMask.Transfer);
330 330
331 uint basePerms = (RootPart.BaseMask & allmask) | (uint)PermissionMask.Move; 331 uint basePerms = (RootPart.BaseMask & allmask) | (uint)PermissionMask.Move;
332 bool noBaseTransfer = (basePerms & (uint)PermissionMask.Transfer) == 0; 332 bool noBaseTransfer = (basePerms & (uint)PermissionMask.Transfer) == 0;
@@ -350,7 +350,7 @@ namespace OpenSim.Region.Framework.Scenes
350 // recover modify and move 350 // recover modify and move
351 rootOwnerPerms &= movemodmask; 351 rootOwnerPerms &= movemodmask;
352 owner |= rootOwnerPerms; 352 owner |= rootOwnerPerms;
353 if((owner & copytransfermast) == 0) 353 if((owner & copytransfermask) == 0)
354 owner |= (uint)PermissionMask.Transfer; 354 owner |= (uint)PermissionMask.Transfer;
355 355
356 owner &= basePerms; 356 owner &= basePerms;
@@ -479,17 +479,13 @@ namespace OpenSim.Region.Framework.Scenes
479 } 479 }
480 } 480 }
481 481
482 public uint GetEffectivePermissions()
483 {
484 return GetEffectivePermissions(false);
485 }
486
487 public uint GetEffectivePermissions(bool useBase) 482 public uint GetEffectivePermissions(bool useBase)
488 { 483 {
489 uint perms=(uint)(PermissionMask.Modify | 484 uint perms=(uint)(PermissionMask.Modify |
490 PermissionMask.Copy | 485 PermissionMask.Copy |
491 PermissionMask.Move | 486 PermissionMask.Move |
492 PermissionMask.Transfer) | 7; 487 PermissionMask.Transfer |
488 PermissionMask.FoldedMask);
493 489
494 uint ownerMask = 0x7fffffff; 490 uint ownerMask = 0x7fffffff;
495 491
@@ -512,17 +508,8 @@ namespace OpenSim.Region.Framework.Scenes
512 perms &= ~(uint)PermissionMask.Copy; 508 perms &= ~(uint)PermissionMask.Copy;
513 if ((ownerMask & (uint)PermissionMask.Transfer) == 0) 509 if ((ownerMask & (uint)PermissionMask.Transfer) == 0)
514 perms &= ~(uint)PermissionMask.Transfer; 510 perms &= ~(uint)PermissionMask.Transfer;
515 511 if ((ownerMask & (uint)PermissionMask.Export) == 0)
516 // If root prim permissions are applied here, this would screw 512 perms &= ~(uint)PermissionMask.Export;
517 // with in-inventory manipulation of the next owner perms
518 // in a major way. So, let's move this to the give itself.
519 // Yes. I know. Evil.
520// if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Modify) == 0)
521// perms &= ~((uint)PermissionMask.Modify >> 13);
522// if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Copy) == 0)
523// perms &= ~((uint)PermissionMask.Copy >> 13);
524// if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Transfer) == 0)
525// perms &= ~((uint)PermissionMask.Transfer >> 13);
526 513
527 return perms; 514 return perms;
528 } 515 }
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index e4f18d9..f948336 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -5288,9 +5288,9 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
5288 // Export needs to be preserved in the base and everyone 5288 // Export needs to be preserved in the base and everyone
5289 // mask, but removed in the owner mask as a next owner 5289 // mask, but removed in the owner mask as a next owner
5290 // can never change the export status 5290 // can never change the export status
5291 BaseMask &= NextOwnerMask | (uint)PermissionMask.Export; 5291 BaseMask &= (NextOwnerMask | (uint)PermissionMask.Export);
5292 OwnerMask &= NextOwnerMask; 5292 OwnerMask &= NextOwnerMask;
5293 EveryoneMask &= NextOwnerMask | (uint)PermissionMask.Export; 5293 EveryoneMask &= (NextOwnerMask | (uint)PermissionMask.Export);
5294 GroupMask = 0; // Giving an object zaps group permissions 5294 GroupMask = 0; // Giving an object zaps group permissions
5295 5295
5296 Inventory.ApplyNextOwnerPermissions(); 5296 Inventory.ApplyNextOwnerPermissions();
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index b53c355..894078d 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -1340,33 +1340,38 @@ namespace OpenSim.Region.Framework.Scenes
1340 1340
1341 public uint MaskEffectivePermissions() 1341 public uint MaskEffectivePermissions()
1342 { 1342 {
1343 // used to propagate permissions restrictions outwards
1344 // Modify does not propagate outwards.
1343 uint mask=0x7fffffff; 1345 uint mask=0x7fffffff;
1344 1346
1345 foreach (TaskInventoryItem item in m_items.Values) 1347 foreach (TaskInventoryItem item in m_items.Values)
1346 { 1348 {
1347 if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Copy) == 0) 1349 if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Copy) == 0)
1348 mask &= ~((uint)PermissionMask.Copy >> 13); 1350 mask &= ~((uint)PermissionMask.FoldedCopy);
1349 if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Transfer) == 0) 1351 if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Transfer) == 0)
1350 mask &= ~((uint)PermissionMask.Transfer >> 13); 1352 mask &= ~((uint)PermissionMask.FoldedTransfer);
1351 if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Modify) == 0) 1353 if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Export) == 0)
1352 mask &= ~((uint)PermissionMask.Modify >> 13); 1354 mask &= ~((uint)PermissionMask.FoldedExport);
1353 1355
1356 // this breaks some SL legal use cases
1357 // there should be no folding from task inventory
1358/*
1354 if (item.InvType == (int)InventoryType.Object) 1359 if (item.InvType == (int)InventoryType.Object)
1355 { 1360 {
1356 if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0) 1361 if ((item.CurrentPermissions & ((uint)PermissionMask.FoldedCopy)) == 0)
1357 mask &= ~((uint)PermissionMask.Copy >> 13); 1362 mask &= ~((uint)PermissionMask.FoldedCopy);
1358 if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0) 1363 if ((item.CurrentPermissions & ((uint)PermissionMask.FoldedTransfer)) == 0)
1359 mask &= ~((uint)PermissionMask.Transfer >> 13); 1364 mask &= ~((uint)PermissionMask.FoldedTransfer);
1360 if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0) 1365 if ((item.CurrentPermissions & (uint)PermissionMask.FoldedExport) == 0)
1361 mask &= ~((uint)PermissionMask.Modify >> 13); 1366 mask &= ~((uint)PermissionMask.FoldedExport);
1362 } 1367 }
1363 1368*/
1364 if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) 1369 if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
1365 mask &= ~(uint)PermissionMask.Copy; 1370 mask &= ~(uint)PermissionMask.Copy;
1366 if ((item.CurrentPermissions & (uint)PermissionMask.Transfer) == 0) 1371 if ((item.CurrentPermissions & (uint)PermissionMask.Transfer) == 0)
1367 mask &= ~(uint)PermissionMask.Transfer; 1372 mask &= ~(uint)PermissionMask.Transfer;
1368 if ((item.CurrentPermissions & (uint)PermissionMask.Modify) == 0) 1373 if ((item.CurrentPermissions & (uint)PermissionMask.Export) == 0)
1369 mask &= ~(uint)PermissionMask.Modify; 1374 mask &= ~((uint)PermissionMask.Export);
1370 } 1375 }
1371 return mask; 1376 return mask;
1372 } 1377 }
@@ -1375,19 +1380,24 @@ namespace OpenSim.Region.Framework.Scenes
1375 { 1380 {
1376 foreach (TaskInventoryItem item in m_items.Values) 1381 foreach (TaskInventoryItem item in m_items.Values)
1377 { 1382 {
1378 if (item.InvType == (int)InventoryType.Object && (item.CurrentPermissions & 7) != 0) 1383
1384 // this breaks legal SL use cases
1385 // there should be no unfold into task inventory
1386/*
1387 if (item.InvType == (int)InventoryType.Object && (item.CurrentPermissions & (uint)PermissionMask.FoldedMask) != 0)
1379 { 1388 {
1380// m_log.DebugFormat ( 1389// m_log.DebugFormat (
1381// "[SCENE OBJECT PART INVENTORY]: Applying next permissions {0} to {1} in {2} with current {3}, base {4}, everyone {5}", 1390// "[SCENE OBJECT PART INVENTORY]: Applying next permissions {0} to {1} in {2} with current {3}, base {4}, everyone {5}",
1382// item.NextPermissions, item.Name, m_part.Name, item.CurrentPermissions, item.BasePermissions, item.EveryonePermissions); 1391// item.NextPermissions, item.Name, m_part.Name, item.CurrentPermissions, item.BasePermissions, item.EveryonePermissions);
1383 1392
1384 if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0) 1393 if ((item.CurrentPermissions & ((uint)PermissionMask.FoldedCopy)) == 0)
1385 item.CurrentPermissions &= ~(uint)PermissionMask.Copy; 1394 item.CurrentPermissions &= ~(uint)PermissionMask.Copy;
1386 if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0) 1395 if ((item.CurrentPermissions & ((uint)PermissionMask.FoldedTransfer)) == 0)
1387 item.CurrentPermissions &= ~(uint)PermissionMask.Transfer; 1396 item.CurrentPermissions &= ~(uint)PermissionMask.Transfer;
1388 if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0) 1397 if ((item.CurrentPermissions & ((uint)PermissionMask.FoldedModify)) == 0)
1389 item.CurrentPermissions &= ~(uint)PermissionMask.Modify; 1398 item.CurrentPermissions &= ~(uint)PermissionMask.Modify;
1390 } 1399 }
1400*/
1391 item.CurrentPermissions &= item.NextPermissions; 1401 item.CurrentPermissions &= item.NextPermissions;
1392 item.BasePermissions &= item.NextPermissions; 1402 item.BasePermissions &= item.NextPermissions;
1393 item.EveryonePermissions &= item.NextPermissions; 1403 item.EveryonePermissions &= item.NextPermissions;