aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/Permissions
diff options
context:
space:
mode:
authorUbitUmarov2017-01-19 11:34:40 +0000
committerUbitUmarov2017-01-19 11:34:40 +0000
commitfe9a785ecc8747df2b15575f0d0bd88025db881b (patch)
tree5004aec8f297d7aef6f0cf8204ed17d467ded025 /OpenSim/Region/CoreModules/World/Permissions
parenta few more aux methods and changes (diff)
downloadopensim-SC-fe9a785ecc8747df2b15575f0d0bd88025db881b.zip
opensim-SC-fe9a785ecc8747df2b15575f0d0bd88025db881b.tar.gz
opensim-SC-fe9a785ecc8747df2b15575f0d0bd88025db881b.tar.bz2
opensim-SC-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/World/Permissions')
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs26
1 files changed, 16 insertions, 10 deletions
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 }