diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 59 |
1 files changed, 25 insertions, 34 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index b53c355..8c9d0bb 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -1332,6 +1332,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1332 | { | 1332 | { |
1333 | foreach (TaskInventoryItem item in m_items.Values) | 1333 | foreach (TaskInventoryItem item in m_items.Values) |
1334 | { | 1334 | { |
1335 | if(item.InvType == (sbyte)InventoryType.Landmark) | ||
1336 | continue; | ||
1335 | owner &= item.CurrentPermissions; | 1337 | owner &= item.CurrentPermissions; |
1336 | group &= item.GroupPermissions; | 1338 | group &= item.GroupPermissions; |
1337 | everyone &= item.EveryonePermissions; | 1339 | everyone &= item.EveryonePermissions; |
@@ -1340,33 +1342,35 @@ namespace OpenSim.Region.Framework.Scenes | |||
1340 | 1342 | ||
1341 | public uint MaskEffectivePermissions() | 1343 | public uint MaskEffectivePermissions() |
1342 | { | 1344 | { |
1345 | // used to propagate permissions restrictions outwards | ||
1346 | // Modify does not propagate outwards. | ||
1343 | uint mask=0x7fffffff; | 1347 | uint mask=0x7fffffff; |
1344 | 1348 | ||
1345 | foreach (TaskInventoryItem item in m_items.Values) | 1349 | foreach (TaskInventoryItem item in m_items.Values) |
1346 | { | 1350 | { |
1347 | if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Copy) == 0) | 1351 | if(item.InvType == (sbyte)InventoryType.Landmark) |
1348 | mask &= ~((uint)PermissionMask.Copy >> 13); | 1352 | continue; |
1349 | if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Transfer) == 0) | 1353 | |
1350 | mask &= ~((uint)PermissionMask.Transfer >> 13); | 1354 | // apply current to normal permission bits |
1351 | if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Modify) == 0) | 1355 | uint newperms = item.CurrentPermissions; |
1352 | mask &= ~((uint)PermissionMask.Modify >> 13); | ||
1353 | |||
1354 | if (item.InvType == (int)InventoryType.Object) | ||
1355 | { | ||
1356 | if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0) | ||
1357 | mask &= ~((uint)PermissionMask.Copy >> 13); | ||
1358 | if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0) | ||
1359 | mask &= ~((uint)PermissionMask.Transfer >> 13); | ||
1360 | if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0) | ||
1361 | mask &= ~((uint)PermissionMask.Modify >> 13); | ||
1362 | } | ||
1363 | 1356 | ||
1364 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) | 1357 | if ((newperms & (uint)PermissionMask.Copy) == 0) |
1365 | mask &= ~(uint)PermissionMask.Copy; | 1358 | mask &= ~(uint)PermissionMask.Copy; |
1366 | if ((item.CurrentPermissions & (uint)PermissionMask.Transfer) == 0) | 1359 | if ((newperms & (uint)PermissionMask.Transfer) == 0) |
1367 | mask &= ~(uint)PermissionMask.Transfer; | 1360 | mask &= ~(uint)PermissionMask.Transfer; |
1368 | if ((item.CurrentPermissions & (uint)PermissionMask.Modify) == 0) | 1361 | if ((newperms & (uint)PermissionMask.Export) == 0) |
1369 | mask &= ~(uint)PermissionMask.Modify; | 1362 | mask &= ~((uint)PermissionMask.Export); |
1363 | |||
1364 | // apply next owner restricted by current to folded bits | ||
1365 | newperms &= item.NextPermissions; | ||
1366 | |||
1367 | if ((newperms & (uint)PermissionMask.Copy) == 0) | ||
1368 | mask &= ~((uint)PermissionMask.FoldedCopy); | ||
1369 | if ((newperms & (uint)PermissionMask.Transfer) == 0) | ||
1370 | mask &= ~((uint)PermissionMask.FoldedTransfer); | ||
1371 | if ((newperms & (uint)PermissionMask.Export) == 0) | ||
1372 | mask &= ~((uint)PermissionMask.FoldedExport); | ||
1373 | |||
1370 | } | 1374 | } |
1371 | return mask; | 1375 | return mask; |
1372 | } | 1376 | } |
@@ -1375,19 +1379,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1375 | { | 1379 | { |
1376 | foreach (TaskInventoryItem item in m_items.Values) | 1380 | foreach (TaskInventoryItem item in m_items.Values) |
1377 | { | 1381 | { |
1378 | if (item.InvType == (int)InventoryType.Object && (item.CurrentPermissions & 7) != 0) | ||
1379 | { | ||
1380 | // m_log.DebugFormat ( | ||
1381 | // "[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); | ||
1383 | |||
1384 | if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0) | ||
1385 | item.CurrentPermissions &= ~(uint)PermissionMask.Copy; | ||
1386 | if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0) | ||
1387 | item.CurrentPermissions &= ~(uint)PermissionMask.Transfer; | ||
1388 | if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0) | ||
1389 | item.CurrentPermissions &= ~(uint)PermissionMask.Modify; | ||
1390 | } | ||
1391 | item.CurrentPermissions &= item.NextPermissions; | 1382 | item.CurrentPermissions &= item.NextPermissions; |
1392 | item.BasePermissions &= item.NextPermissions; | 1383 | item.BasePermissions &= item.NextPermissions; |
1393 | item.EveryonePermissions &= item.NextPermissions; | 1384 | item.EveryonePermissions &= item.NextPermissions; |