diff options
author | UbitUmarov | 2017-01-19 11:34:40 +0000 |
---|---|---|
committer | UbitUmarov | 2017-01-19 11:34:40 +0000 |
commit | fe9a785ecc8747df2b15575f0d0bd88025db881b (patch) | |
tree | 5004aec8f297d7aef6f0cf8204ed17d467ded025 /OpenSim/Region/CoreModules | |
parent | a few more aux methods and changes (diff) | |
download | opensim-SC_OLD-fe9a785ecc8747df2b15575f0d0bd88025db881b.zip opensim-SC_OLD-fe9a785ecc8747df2b15575f0d0bd88025db881b.tar.gz opensim-SC_OLD-fe9a785ecc8747df2b15575f0d0bd88025db881b.tar.bz2 opensim-SC_OLD-fe9a785ecc8747df2b15575f0d0bd88025db881b.tar.xz |
object Take and TakeCopy are for in scene SOPs and SPs and permitions module is NOT a shared module
Diffstat (limited to 'OpenSim/Region/CoreModules')
3 files changed, 25 insertions, 17 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 | } |