diff options
author | Justin Clark-Casey (justincc) | 2015-02-03 23:40:32 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2015-02-03 23:43:30 +0000 |
commit | 1d2616e7a24882b197de0db3d76c1e02a7cfcd90 (patch) | |
tree | 8ba2f006e029528345f1cb279ac0399ac52e9d90 /OpenSim/Region/CoreModules | |
parent | correct some minor comment misspellings in last commit (diff) | |
download | opensim-SC-1d2616e7a24882b197de0db3d76c1e02a7cfcd90.zip opensim-SC-1d2616e7a24882b197de0db3d76c1e02a7cfcd90.tar.gz opensim-SC-1d2616e7a24882b197de0db3d76c1e02a7cfcd90.tar.bz2 opensim-SC-1d2616e7a24882b197de0db3d76c1e02a7cfcd90.tar.xz |
If the owner of an object is taking a copy from the scene (e.g. via the "take copy" option on a viewer) then only require owner copy perms, not copy and transfer.
This matches Linden Lab behaviour and what was already possible via shift-copy.
Transfer would not apply here as the owner and copier are the same.
This is the only functional change, all other current take copy logic remains the same.
Adds regression tests around relevant take copy cases.
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | 27 |
2 files changed, 16 insertions, 15 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index f958510..a77bc63 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | |||
@@ -614,6 +614,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
614 | protected InventoryItemBase CreateItemForObject( | 614 | protected InventoryItemBase CreateItemForObject( |
615 | DeRezAction action, IClientAPI remoteClient, SceneObjectGroup so, UUID folderID) | 615 | DeRezAction action, IClientAPI remoteClient, SceneObjectGroup so, UUID folderID) |
616 | { | 616 | { |
617 | // m_log.DebugFormat( | ||
618 | // "[BASIC INVENTORY ACCESS MODULE]: Creating item for object {0} {1} for folder {2}, action {3}", | ||
619 | // so.Name, so.UUID, folderID, action); | ||
620 | // | ||
617 | // Get the user info of the item destination | 621 | // Get the user info of the item destination |
618 | // | 622 | // |
619 | UUID userID = UUID.Zero; | 623 | UUID userID = UUID.Zero; |
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index d8f9f8c..780ec69 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |||
@@ -801,8 +801,10 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
801 | 801 | ||
802 | // Friends with benefits should be able to edit the objects too | 802 | // Friends with benefits should be able to edit the objects too |
803 | if (IsFriendWithPerms(currentUser, objectOwner)) | 803 | if (IsFriendWithPerms(currentUser, objectOwner)) |
804 | { | ||
804 | // Return immediately, so that the administrator can share objects with friends | 805 | // Return immediately, so that the administrator can share objects with friends |
805 | return true; | 806 | return true; |
807 | } | ||
806 | 808 | ||
807 | // Users should be able to edit what is over their land. | 809 | // Users should be able to edit what is over their land. |
808 | ILandObject parcel = m_scene.LandChannel.GetLandObject(group.AbsolutePosition.X, group.AbsolutePosition.Y); | 810 | ILandObject parcel = m_scene.LandChannel.GetLandObject(group.AbsolutePosition.X, group.AbsolutePosition.Y); |
@@ -1522,6 +1524,9 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1522 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 1524 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
1523 | 1525 | ||
1524 | bool permission = GenericObjectPermission(userID, objectID, false); | 1526 | bool permission = GenericObjectPermission(userID, objectID, false); |
1527 | |||
1528 | SceneObjectGroup so = (SceneObjectGroup)m_scene.Entities[objectID]; | ||
1529 | |||
1525 | if (!permission) | 1530 | if (!permission) |
1526 | { | 1531 | { |
1527 | if (!m_scene.Entities.ContainsKey(objectID)) | 1532 | if (!m_scene.Entities.ContainsKey(objectID)) |
@@ -1535,31 +1540,23 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1535 | return false; | 1540 | return false; |
1536 | } | 1541 | } |
1537 | 1542 | ||
1538 | SceneObjectGroup task = (SceneObjectGroup)m_scene.Entities[objectID]; | ||
1539 | // UUID taskOwner = null; | 1543 | // UUID taskOwner = null; |
1540 | // Added this because at this point in time it wouldn't be wise for | 1544 | // Added this because at this point in time it wouldn't be wise for |
1541 | // the administrator object permissions to take effect. | 1545 | // the administrator object permissions to take effect. |
1542 | // UUID objectOwner = task.OwnerID; | 1546 | // UUID objectOwner = task.OwnerID; |
1543 | 1547 | ||
1544 | if ((task.RootPart.EveryoneMask & PERM_COPY) != 0) | 1548 | if ((so.RootPart.EveryoneMask & PERM_COPY) != 0) |
1545 | permission = true; | 1549 | permission = true; |
1550 | } | ||
1546 | 1551 | ||
1547 | if (task.OwnerID != userID) | 1552 | if (so.OwnerID != userID) |
1548 | { | 1553 | { |
1549 | if ((task.GetEffectivePermissions() & (PERM_COPY | PERM_TRANS)) != (PERM_COPY | PERM_TRANS)) | 1554 | if ((so.GetEffectivePermissions() & (PERM_COPY | PERM_TRANS)) != (PERM_COPY | PERM_TRANS)) |
1550 | permission = false; | 1555 | permission = false; |
1551 | } | ||
1552 | else | ||
1553 | { | ||
1554 | if ((task.GetEffectivePermissions() & PERM_COPY) != PERM_COPY) | ||
1555 | permission = false; | ||
1556 | } | ||
1557 | } | 1556 | } |
1558 | else | 1557 | else |
1559 | { | 1558 | { |
1560 | SceneObjectGroup task = (SceneObjectGroup)m_scene.Entities[objectID]; | 1559 | if ((so.GetEffectivePermissions() & PERM_COPY) != PERM_COPY) |
1561 | |||
1562 | if ((task.GetEffectivePermissions() & (PERM_COPY | PERM_TRANS)) != (PERM_COPY | PERM_TRANS)) | ||
1563 | permission = false; | 1560 | permission = false; |
1564 | } | 1561 | } |
1565 | 1562 | ||