aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2015-02-03 23:40:32 +0000
committerJustin Clark-Casey (justincc)2015-02-03 23:43:30 +0000
commit1d2616e7a24882b197de0db3d76c1e02a7cfcd90 (patch)
tree8ba2f006e029528345f1cb279ac0399ac52e9d90 /OpenSim/Region/CoreModules/World
parentcorrect some minor comment misspellings in last commit (diff)
downloadopensim-SC_OLD-1d2616e7a24882b197de0db3d76c1e02a7cfcd90.zip
opensim-SC_OLD-1d2616e7a24882b197de0db3d76c1e02a7cfcd90.tar.gz
opensim-SC_OLD-1d2616e7a24882b197de0db3d76c1e02a7cfcd90.tar.bz2
opensim-SC_OLD-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/World')
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs27
1 files changed, 12 insertions, 15 deletions
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