aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs5
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs11
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs26
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Permissions.cs12
5 files changed, 35 insertions, 25 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index 8b8ac20..a900a2a 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -1322,7 +1322,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
1322 if (part == null) 1322 if (part == null)
1323 return; 1323 return;
1324 1324
1325 if (!m_scene.Permissions.CanTakeObject(part.UUID, remoteClient.AgentId)) 1325 SceneObjectGroup group = part.ParentGroup;
1326
1327 if (!m_scene.Permissions.CanTakeObject(group, sp))
1326 { 1328 {
1327 remoteClient.SendAgentAlertMessage( 1329 remoteClient.SendAgentAlertMessage(
1328 "You don't have sufficient permissions to attach this object", false); 1330 "You don't have sufficient permissions to attach this object", false);
@@ -1334,7 +1336,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
1334 AttachmentPt &= 0x7f; 1336 AttachmentPt &= 0x7f;
1335 1337
1336 // Calls attach with a Zero position 1338 // Calls attach with a Zero position
1337 SceneObjectGroup group = part.ParentGroup;
1338 if (AttachObject(sp, group , AttachmentPt, false, true, append)) 1339 if (AttachObject(sp, group , AttachmentPt, false, true, append))
1339 { 1340 {
1340 if (DebugLevel > 0) 1341 if (DebugLevel > 0)
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
index 95e7456..ba3a7c9 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
@@ -541,16 +541,17 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
541 541
542 #region Permissions 542 #region Permissions
543 543
544 private bool CanTakeObject(UUID objectID, UUID stealer, Scene scene) 544 private bool CanTakeObject(SceneObjectGroup sog, ScenePresence sp)
545 { 545 {
546 if (m_bypassPermissions) return true; 546 if (m_bypassPermissions) return true;
547 547
548 if (!m_OutboundPermission && !UserManagementModule.IsLocalGridUser(stealer)) 548 if(sp == null || sog == null)
549 return false;
550
551 if (!m_OutboundPermission && !UserManagementModule.IsLocalGridUser(sp.UUID))
549 { 552 {
550 SceneObjectGroup sog = null; 553 if (sog.OwnerID == sp.UUID)
551 if (m_Scene.TryGetSceneObjectGroup(objectID, out sog) && sog.OwnerID == stealer)
552 return true; 554 return true;
553
554 return false; 555 return false;
555 } 556 }
556 557
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index da4b826..3f310c7 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -1671,39 +1671,45 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1671 return IsGroupMember(groupID, userID, (ulong)GroupPowers.ObjectSetForSale); 1671 return IsGroupMember(groupID, userID, (ulong)GroupPowers.ObjectSetForSale);
1672 } 1672 }
1673 1673
1674 private bool CanTakeObject(UUID objectID, UUID userID, Scene scene) 1674 private bool CanTakeObject(SceneObjectGroup sog, ScenePresence sp)
1675 { 1675 {
1676 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 1676 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
1677 if (m_bypassPermissions) return m_bypassPermissionsValue; 1677 if (m_bypassPermissions) return m_bypassPermissionsValue;
1678 1678
1679 SceneObjectGroup sog = m_scene.GetGroupByPrim(objectID); 1679 if (sog == null || sog.IsDeleted || sp == null || sp.IsDeleted)
1680 if (sog == null) 1680 return false;
1681
1682 // take is not a attachment op
1683 if(sog.IsAttachment)
1681 return false; 1684 return false;
1682 1685
1683 // ignore locked, viewers shell ask for confirmation 1686 // ignore locked, viewers shell ask for confirmation
1684 uint perms = GetObjectPermissions(userID, sog, false); 1687 uint perms = GetObjectPermissions(sp, sog, false);
1685 if((perms & (uint)PermissionMask.Modify) == 0) 1688 if((perms & (uint)PermissionMask.Modify) == 0)
1686 return false; 1689 return false;
1687 1690
1688 if (sog.OwnerID != userID && ((perms & (uint)PermissionMask.Transfer) == 0)) 1691 if (sog.OwnerID != sp.UUID && ((perms & (uint)PermissionMask.Transfer) == 0))
1689 return false; 1692 return false;
1690 return true; 1693 return true;
1691 } 1694 }
1692 1695
1693 private bool CanTakeCopyObject(UUID objectID, UUID userID, Scene inScene) 1696 private bool CanTakeCopyObject(SceneObjectGroup sog, ScenePresence sp)
1694 { 1697 {
1695 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 1698 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
1696 if (m_bypassPermissions) return m_bypassPermissionsValue; 1699 if (m_bypassPermissions) return m_bypassPermissionsValue;
1697 1700
1698 SceneObjectGroup sog = m_scene.GetGroupByPrim(objectID); 1701 if (sog == null || sog.IsDeleted || sp == null || sp.IsDeleted)
1699 if (sog == null)
1700 return false; 1702 return false;
1701 1703
1702 uint perms = GetObjectPermissions(userID, sog, true); 1704 // refuse on attachments
1705 if(sog.IsAttachment && !sp.IsGod)
1706 return false;
1707
1708 uint perms = GetObjectPermissions(sp, sog, true);
1703 if((perms & (uint)PermissionMask.Copy) == 0) 1709 if((perms & (uint)PermissionMask.Copy) == 0)
1704 return false; 1710 return false;
1705 1711
1706 if(sog.OwnerID != userID && sog.OwnerID != sog.GroupID && (perms & (uint)PermissionMask.Transfer) == 0) 1712 if(sog.OwnerID != sp.UUID && sog.OwnerID != sog.GroupID && (perms & (uint)PermissionMask.Transfer) == 0)
1707 return false; 1713 return false;
1708 return true; 1714 return true;
1709 } 1715 }
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 473589a..ad913f7 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -2126,6 +2126,8 @@ namespace OpenSim.Region.Framework.Scenes
2126 List<SceneObjectGroup> deleteGroups = new List<SceneObjectGroup>(); 2126 List<SceneObjectGroup> deleteGroups = new List<SceneObjectGroup>();
2127 List<SceneObjectGroup> takeGroups = new List<SceneObjectGroup>(); 2127 List<SceneObjectGroup> takeGroups = new List<SceneObjectGroup>();
2128 2128
2129 ScenePresence sp = remoteClient.SceneAgent as ScenePresence;
2130
2129 // Start with true for both, then remove the flags if objects 2131 // Start with true for both, then remove the flags if objects
2130 // that we can't derez are part of the selection 2132 // that we can't derez are part of the selection
2131 bool permissionToTake = true; 2133 bool permissionToTake = true;
@@ -2180,14 +2182,14 @@ namespace OpenSim.Region.Framework.Scenes
2180 { 2182 {
2181 if (action == DeRezAction.TakeCopy) 2183 if (action == DeRezAction.TakeCopy)
2182 { 2184 {
2183 if (!Permissions.CanTakeCopyObject(grp.UUID, remoteClient.AgentId)) 2185 if (!Permissions.CanTakeCopyObject(grp, sp))
2184 permissionToTakeCopy = false; 2186 permissionToTakeCopy = false;
2185 } 2187 }
2186 else 2188 else
2187 { 2189 {
2188 permissionToTakeCopy = false; 2190 permissionToTakeCopy = false;
2189 } 2191 }
2190 if (!Permissions.CanTakeObject(grp.UUID, remoteClient.AgentId)) 2192 if (!Permissions.CanTakeObject(grp, sp))
2191 permissionToTake = false; 2193 permissionToTake = false;
2192 2194
2193 if (!Permissions.CanDeleteObject(grp.UUID, remoteClient.AgentId)) 2195 if (!Permissions.CanDeleteObject(grp.UUID, remoteClient.AgentId))
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
index e42d4c2..8194606 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
@@ -44,9 +44,9 @@ namespace OpenSim.Region.Framework.Scenes
44 public delegate bool RezObjectHandler(int objectCount, UUID owner, Vector3 objectPosition, Scene scene); 44 public delegate bool RezObjectHandler(int objectCount, UUID owner, Vector3 objectPosition, Scene scene);
45 public delegate bool DeleteObjectHandler(UUID objectID, UUID deleter, Scene scene); 45 public delegate bool DeleteObjectHandler(UUID objectID, UUID deleter, Scene scene);
46 public delegate bool TransferObjectHandler(UUID objectID, UUID recipient, Scene scene); 46 public delegate bool TransferObjectHandler(UUID objectID, UUID recipient, Scene scene);
47 public delegate bool TakeObjectHandler(UUID objectID, UUID stealer, Scene scene); 47 public delegate bool TakeObjectHandler(SceneObjectGroup sog, ScenePresence sp);
48 public delegate bool SellGroupObjectHandler(UUID userID, UUID groupID, Scene scene); 48 public delegate bool SellGroupObjectHandler(UUID userID, UUID groupID, Scene scene);
49 public delegate bool TakeCopyObjectHandler(UUID objectID, UUID userID, Scene inScene); 49 public delegate bool TakeCopyObjectHandler(SceneObjectGroup sog, ScenePresence sp);
50 public delegate bool DuplicateObjectHandler(int objectCount, UUID objectID, UUID owner, Scene scene, Vector3 objectPosition); 50 public delegate bool DuplicateObjectHandler(int objectCount, UUID objectID, UUID owner, Scene scene, Vector3 objectPosition);
51 public delegate bool EditObjectHandler(UUID objectID, UUID editorID, Scene scene); 51 public delegate bool EditObjectHandler(UUID objectID, UUID editorID, Scene scene);
52 public delegate bool EditObjectInventoryHandler(UUID objectID, UUID editorID, Scene scene); 52 public delegate bool EditObjectInventoryHandler(UUID objectID, UUID editorID, Scene scene);
@@ -300,7 +300,7 @@ namespace OpenSim.Region.Framework.Scenes
300 #endregion 300 #endregion
301 301
302 #region TAKE OBJECT 302 #region TAKE OBJECT
303 public bool CanTakeObject(UUID objectID, UUID AvatarTakingUUID) 303 public bool CanTakeObject(SceneObjectGroup sog, ScenePresence sp)
304 { 304 {
305 bool result = true; 305 bool result = true;
306 306
@@ -310,7 +310,7 @@ namespace OpenSim.Region.Framework.Scenes
310 Delegate[] list = handler.GetInvocationList(); 310 Delegate[] list = handler.GetInvocationList();
311 foreach (TakeObjectHandler h in list) 311 foreach (TakeObjectHandler h in list)
312 { 312 {
313 if (h(objectID, AvatarTakingUUID, m_scene) == false) 313 if (h(sog, sp) == false)
314 { 314 {
315 result = false; 315 result = false;
316 break; 316 break;
@@ -357,7 +357,7 @@ namespace OpenSim.Region.Framework.Scenes
357 357
358 358
359 #region TAKE COPY OBJECT 359 #region TAKE COPY OBJECT
360 public bool CanTakeCopyObject(UUID objectID, UUID userID) 360 public bool CanTakeCopyObject(SceneObjectGroup sog, ScenePresence sp)
361 { 361 {
362 bool result = true; 362 bool result = true;
363 363
@@ -367,7 +367,7 @@ namespace OpenSim.Region.Framework.Scenes
367 Delegate[] list = handler.GetInvocationList(); 367 Delegate[] list = handler.GetInvocationList();
368 foreach (TakeCopyObjectHandler h in list) 368 foreach (TakeCopyObjectHandler h in list)
369 { 369 {
370 if (h(objectID, userID, m_scene) == false) 370 if (h(sog, sp) == false)
371 { 371 {
372 result = false; 372 result = false;
373 break; 373 break;