diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 46 |
1 files changed, 28 insertions, 18 deletions
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; |