aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie2010-09-21 02:08:55 +0200
committerMelanie2010-09-21 02:08:55 +0200
commit7229bc4fbda804d41525356027269ca9a665b0bf (patch)
tree16c57e5136a0f2064b95627a5e0e77bb7fe90fe6
parentFix a merge artefact that broke script state persistence in XAttachments (diff)
downloadopensim-SC_OLD-7229bc4fbda804d41525356027269ca9a665b0bf.zip
opensim-SC_OLD-7229bc4fbda804d41525356027269ca9a665b0bf.tar.gz
opensim-SC_OLD-7229bc4fbda804d41525356027269ca9a665b0bf.tar.bz2
opensim-SC_OLD-7229bc4fbda804d41525356027269ca9a665b0bf.tar.xz
Refactor script create permission into the perms module
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs28
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs10
2 files changed, 23 insertions, 15 deletions
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index ecfd211..e46fb1c 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -1780,10 +1780,28 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1780 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 1780 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
1781 if (m_bypassPermissions) return m_bypassPermissionsValue; 1781 if (m_bypassPermissions) return m_bypassPermissionsValue;
1782 1782
1783 if ((int)InventoryType.LSL == invType) 1783 SceneObjectPart part = scene.GetSceneObjectPart(objectID);
1784 if (m_allowedScriptCreators == UserSet.Administrators && !IsAdministrator(userID)) 1784 ScenePresence p = scene.GetScenePresence(userID);
1785 return false; 1785
1786 1786 if (part == null || p == null)
1787 return false;
1788
1789 if (!IsAdministrator(userID))
1790 {
1791 if (part.OwnerID != userID)
1792 {
1793 // Group permissions
1794 if ((part.GroupID == UUID.Zero) || (p.ControllingClient.GetGroupPowers(part.GroupID) == 0) || ((part.GroupMask & (uint)PermissionMask.Modify) == 0))
1795 return false;
1796 } else {
1797 if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0)
1798 return false;
1799 }
1800 if ((int)InventoryType.LSL == invType)
1801 if (m_allowedScriptCreators == UserSet.Administrators)
1802 return false;
1803 }
1804
1787 return true; 1805 return true;
1788 } 1806 }
1789 1807
@@ -1980,4 +1998,4 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1980 return false; 1998 return false;
1981 } 1999 }
1982 } 2000 }
1983} \ No newline at end of file 2001}
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index ac82fda..18cfcbc 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1532,16 +1532,6 @@ namespace OpenSim.Region.Framework.Scenes
1532 if (part == null) 1532 if (part == null)
1533 return; 1533 return;
1534 1534
1535 if (part.OwnerID != remoteClient.AgentId)
1536 {
1537 // Group permissions
1538 if ((part.GroupID == UUID.Zero) || (remoteClient.GetGroupPowers(part.GroupID) == 0) || ((part.GroupMask & (uint)PermissionMask.Modify) == 0))
1539 return;
1540 } else {
1541 if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0)
1542 return;
1543 }
1544
1545 if (!Permissions.CanCreateObjectInventory( 1535 if (!Permissions.CanCreateObjectInventory(
1546 itemBase.InvType, part.UUID, remoteClient.AgentId)) 1536 itemBase.InvType, part.UUID, remoteClient.AgentId))
1547 return; 1537 return;