aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes
diff options
context:
space:
mode:
authormingchen2008-05-08 19:37:57 +0000
committermingchen2008-05-08 19:37:57 +0000
commit6c71a04da8150f7948df7a43f532e525d44cc4e7 (patch)
treee9ed76fd72fa84f9aad4ff5dec66972e08e93b82 /OpenSim/Region/Environment/Scenes
parent* Committing an extra bit of permissions for attaching to ensure that the per... (diff)
downloadopensim-SC_OLD-6c71a04da8150f7948df7a43f532e525d44cc4e7.zip
opensim-SC_OLD-6c71a04da8150f7948df7a43f532e525d44cc4e7.tar.gz
opensim-SC_OLD-6c71a04da8150f7948df7a43f532e525d44cc4e7.tar.bz2
opensim-SC_OLD-6c71a04da8150f7948df7a43f532e525d44cc4e7.tar.xz
*Added all the permission checks to the sceneexternalchecks and modified permission module to follow this.
*This makes permission checking much more modular; allows restrictive and granting module to be made without modifying the existing permission module
Diffstat (limited to 'OpenSim/Region/Environment/Scenes')
-rw-r--r--OpenSim/Region/Environment/Scenes/InnerScene.cs54
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs12
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs4
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs8
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs581
5 files changed, 580 insertions, 79 deletions
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs
index 7ffddb3..2c8c323 100644
--- a/OpenSim/Region/Environment/Scenes/InnerScene.cs
+++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs
@@ -394,7 +394,7 @@ namespace OpenSim.Region.Environment.Scenes
394 if (((SceneObjectGroup)obj).LocalId == objectLocalID) 394 if (((SceneObjectGroup)obj).LocalId == objectLocalID)
395 { 395 {
396 SceneObjectGroup group = (SceneObjectGroup)obj; 396 SceneObjectGroup group = (SceneObjectGroup)obj;
397 if (m_parentScene.Permissions.CanEditObject(remoteClient.AgentId, obj.UUID)) 397 if (m_parentScene.ExternalChecks.ExternalChecksCanEditScript(obj.UUID, remoteClient.AgentId))
398 { 398 {
399 // If the attachment point isn't the same as the one previously used 399 // If the attachment point isn't the same as the one previously used
400 // set it's offset position = 0 so that it appears on the attachment point 400 // set it's offset position = 0 so that it appears on the attachment point
@@ -1051,7 +1051,7 @@ namespace OpenSim.Region.Environment.Scenes
1051 SceneObjectGroup group = GetGroupByPrim(localID); 1051 SceneObjectGroup group = GetGroupByPrim(localID);
1052 if (group != null) 1052 if (group != null)
1053 { 1053 {
1054 if (m_parentScene.Permissions.CanEditObjectPosition(remoteClient.AgentId, group.UUID)) 1054 if (m_parentScene.ExternalChecks.ExternalChecksCanEditObject(group.UUID, remoteClient.AgentId))
1055 { 1055 {
1056 group.Resize(scale, localID); 1056 group.Resize(scale, localID);
1057 } 1057 }
@@ -1062,7 +1062,7 @@ namespace OpenSim.Region.Environment.Scenes
1062 SceneObjectGroup group = GetGroupByPrim(localID); 1062 SceneObjectGroup group = GetGroupByPrim(localID);
1063 if (group != null) 1063 if (group != null)
1064 { 1064 {
1065 if (m_parentScene.Permissions.CanEditObjectPosition(remoteClient.AgentId, group.UUID)) 1065 if (m_parentScene.ExternalChecks.ExternalChecksCanEditObject(group.UUID, remoteClient.AgentId))
1066 { 1066 {
1067 group.GroupResize(scale, localID); 1067 group.GroupResize(scale, localID);
1068 } 1068 }
@@ -1098,7 +1098,7 @@ namespace OpenSim.Region.Environment.Scenes
1098 SceneObjectGroup group = GetGroupByPrim(localID); 1098 SceneObjectGroup group = GetGroupByPrim(localID);
1099 if (group != null) 1099 if (group != null)
1100 { 1100 {
1101 if (m_parentScene.Permissions.CanEditObjectPosition(remoteClient.AgentId, group.UUID)) 1101 if (m_parentScene.ExternalChecks.ExternalChecksCanMoveObject(group.UUID, remoteClient.AgentId))
1102 { 1102 {
1103 group.UpdateSingleRotation(rot, localID); 1103 group.UpdateSingleRotation(rot, localID);
1104 } 1104 }
@@ -1116,7 +1116,7 @@ namespace OpenSim.Region.Environment.Scenes
1116 SceneObjectGroup group = GetGroupByPrim(localID); 1116 SceneObjectGroup group = GetGroupByPrim(localID);
1117 if (group != null) 1117 if (group != null)
1118 { 1118 {
1119 if (m_parentScene.Permissions.CanEditObjectPosition(remoteClient.AgentId, group.UUID)) 1119 if (m_parentScene.ExternalChecks.ExternalChecksCanMoveObject(group.UUID, remoteClient.AgentId))
1120 { 1120 {
1121 group.UpdateGroupRotation(rot); 1121 group.UpdateGroupRotation(rot);
1122 } 1122 }
@@ -1135,7 +1135,7 @@ namespace OpenSim.Region.Environment.Scenes
1135 SceneObjectGroup group = GetGroupByPrim(localID); 1135 SceneObjectGroup group = GetGroupByPrim(localID);
1136 if (group != null) 1136 if (group != null)
1137 { 1137 {
1138 if (m_parentScene.Permissions.CanEditObjectPosition(remoteClient.AgentId, group.UUID)) 1138 if (m_parentScene.ExternalChecks.ExternalChecksCanMoveObject(group.UUID, remoteClient.AgentId))
1139 { 1139 {
1140 group.UpdateGroupRotation(pos, rot); 1140 group.UpdateGroupRotation(pos, rot);
1141 } 1141 }
@@ -1148,12 +1148,13 @@ namespace OpenSim.Region.Environment.Scenes
1148 if (group != null) 1148 if (group != null)
1149 { 1149 {
1150 LLVector3 oldPos = group.AbsolutePosition; 1150 LLVector3 oldPos = group.AbsolutePosition;
1151 if (!m_parentScene.Permissions.CanObjectEntry(remoteClient.AgentId, oldPos, pos) && !group.RootPart.m_IsAttachment) 1151 //FIXME: ObjectEntry is not in ExternalChecks!
1152 { 1152 //if (!m_parentScene.Permissions.CanObjectEntry(remoteClient.AgentId, oldPos, pos) && !group.RootPart.m_IsAttachment)
1153 //{
1153 group.SendGroupTerseUpdate(); 1154 group.SendGroupTerseUpdate();
1154 return; 1155 //return;
1155 } 1156 //}
1156 if (m_parentScene.Permissions.CanEditObjectPosition(remoteClient.AgentId, group.UUID) || group.RootPart.m_IsAttachment) 1157 if (m_parentScene.ExternalChecks.ExternalChecksCanMoveObject(remoteClient.AgentId, group.UUID) || group.RootPart.m_IsAttachment)
1157 { 1158 {
1158 group.UpdateSinglePosition(pos, localID); 1159 group.UpdateSinglePosition(pos, localID);
1159 } 1160 }
@@ -1179,12 +1180,13 @@ namespace OpenSim.Region.Environment.Scenes
1179 } 1180 }
1180 else 1181 else
1181 { 1182 {
1182 if (!m_parentScene.Permissions.CanObjectEntry(remoteClient.AgentId, oldPos, pos) && !group.RootPart.m_IsAttachment) 1183 //FIXME: ObjectEntry not in ExternalChecks!
1183 { 1184 //if (!m_parentScene.Permissions.CanObjectEntry(remoteClient.AgentId, oldPos, pos) && !group.RootPart.m_IsAttachment)
1185 //{
1184 group.SendGroupTerseUpdate(); 1186 group.SendGroupTerseUpdate();
1185 return; 1187 // return;
1186 } 1188 //}
1187 if (m_parentScene.Permissions.CanEditObjectPosition(remoteClient.AgentId, group.UUID) || group.RootPart.m_IsAttachment) 1189 if (m_parentScene.ExternalChecks.ExternalChecksCanMoveObject(group.UUID, remoteClient.AgentId) || group.RootPart.m_IsAttachment)
1188 { 1190 {
1189 group.UpdateGroupPosition(pos); 1191 group.UpdateGroupPosition(pos);
1190 } 1192 }
@@ -1203,7 +1205,7 @@ namespace OpenSim.Region.Environment.Scenes
1203 SceneObjectGroup group = GetGroupByPrim(localID); 1205 SceneObjectGroup group = GetGroupByPrim(localID);
1204 if (group != null) 1206 if (group != null)
1205 { 1207 {
1206 if (m_parentScene.Permissions.CanEditObjectPosition(remoteClient.AgentId, group.UUID)) 1208 if (m_parentScene.ExternalChecks.ExternalChecksCanMoveObject(group.UUID,remoteClient.AgentId))
1207 { 1209 {
1208 group.UpdateTextureEntry(localID, texture); 1210 group.UpdateTextureEntry(localID, texture);
1209 } 1211 }
@@ -1221,7 +1223,7 @@ namespace OpenSim.Region.Environment.Scenes
1221 SceneObjectGroup group = GetGroupByPrim(localID); 1223 SceneObjectGroup group = GetGroupByPrim(localID);
1222 if (group != null) 1224 if (group != null)
1223 { 1225 {
1224 if (m_parentScene.Permissions.CanEditObject(remoteClient.AgentId, group.UUID)) 1226 if (m_parentScene.ExternalChecks.ExternalChecksCanEditObject(group.UUID, remoteClient.AgentId))
1225 { 1227 {
1226 group.UpdatePrimFlags(localID, (ushort)packet.Type, true, packet.ToBytes()); 1228 group.UpdatePrimFlags(localID, (ushort)packet.Type, true, packet.ToBytes());
1227 } 1229 }
@@ -1233,7 +1235,7 @@ namespace OpenSim.Region.Environment.Scenes
1233 SceneObjectGroup group = GetGroupByPrim(objectID); 1235 SceneObjectGroup group = GetGroupByPrim(objectID);
1234 if (group != null) 1236 if (group != null)
1235 { 1237 {
1236 if (m_parentScene.Permissions.CanEditObjectPosition(remoteClient.AgentId, group.UUID))// && PermissionsMngr.) 1238 if (m_parentScene.ExternalChecks.ExternalChecksCanMoveObject(group.UUID, remoteClient.AgentId))// && PermissionsMngr.)
1237 { 1239 {
1238 group.GrabMovement(offset, pos, remoteClient); 1240 group.GrabMovement(offset, pos, remoteClient);
1239 } 1241 }
@@ -1255,7 +1257,7 @@ namespace OpenSim.Region.Environment.Scenes
1255 SceneObjectGroup group = GetGroupByPrim(primLocalID); 1257 SceneObjectGroup group = GetGroupByPrim(primLocalID);
1256 if (group != null) 1258 if (group != null)
1257 { 1259 {
1258 if (m_parentScene.Permissions.CanEditObject(remoteClient.AgentId, group.UUID)) 1260 if (m_parentScene.ExternalChecks.ExternalChecksCanEditObject(group.UUID, remoteClient.AgentId))
1259 { 1261 {
1260 group.SetPartName(Util.CleanString(name), primLocalID); 1262 group.SetPartName(Util.CleanString(name), primLocalID);
1261 } 1263 }
@@ -1272,7 +1274,7 @@ namespace OpenSim.Region.Environment.Scenes
1272 SceneObjectGroup group = GetGroupByPrim(primLocalID); 1274 SceneObjectGroup group = GetGroupByPrim(primLocalID);
1273 if (group != null) 1275 if (group != null)
1274 { 1276 {
1275 if (m_parentScene.Permissions.CanEditObject(remoteClient.AgentId, group.UUID)) 1277 if (m_parentScene.ExternalChecks.ExternalChecksCanEditObject(group.UUID, remoteClient.AgentId))
1276 { 1278 {
1277 group.SetPartDescription(Util.CleanString(description), primLocalID); 1279 group.SetPartDescription(Util.CleanString(description), primLocalID);
1278 } 1280 }
@@ -1285,7 +1287,7 @@ namespace OpenSim.Region.Environment.Scenes
1285 1287
1286 if (group != null) 1288 if (group != null)
1287 { 1289 {
1288 if (m_parentScene.Permissions.CanEditObject(agentID, group.UUID)) 1290 if (m_parentScene.ExternalChecks.ExternalChecksCanEditObject(group.UUID,agentID))
1289 { 1291 {
1290 group.UpdateExtraParam(primLocalID, type, inUse, data); 1292 group.UpdateExtraParam(primLocalID, type, inUse, data);
1291 } 1293 }
@@ -1302,7 +1304,7 @@ namespace OpenSim.Region.Environment.Scenes
1302 SceneObjectGroup group = GetGroupByPrim(primLocalID); 1304 SceneObjectGroup group = GetGroupByPrim(primLocalID);
1303 if (group != null) 1305 if (group != null)
1304 { 1306 {
1305 if (m_parentScene.Permissions.CanEditObjectPosition(agentID, group.GetPartsFullID(primLocalID))) 1307 if (m_parentScene.ExternalChecks.ExternalChecksCanEditObject(group.GetPartsFullID(primLocalID), agentID))
1306 { 1308 {
1307 ObjectShapePacket.ObjectDataBlock shapeData = new ObjectShapePacket.ObjectDataBlock(); 1309 ObjectShapePacket.ObjectDataBlock shapeData = new ObjectShapePacket.ObjectDataBlock();
1308 shapeData.ObjectLocalID = shapeBlock.ObjectLocalID; 1310 shapeData.ObjectLocalID = shapeBlock.ObjectLocalID;
@@ -1489,11 +1491,11 @@ namespace OpenSim.Region.Environment.Scenes
1489 // * Asset/DRM permission bit "modify" is enabled 1491 // * Asset/DRM permission bit "modify" is enabled
1490 //use CanEditObjectPosition 1492 //use CanEditObjectPosition
1491 1493
1492 if (IncludeInSearch && m_parentScene.Permissions.CanEditObject(user, objid)) 1494 if (IncludeInSearch && m_parentScene.ExternalChecks.ExternalChecksCanEditObject(objid, user))
1493 { 1495 {
1494 obj.AddFlag(LLObject.ObjectFlags.JointWheel); 1496 obj.AddFlag(LLObject.ObjectFlags.JointWheel);
1495 } 1497 }
1496 else if (!IncludeInSearch && m_parentScene.Permissions.CanEditObjectPosition(user, objid)) 1498 else if (!IncludeInSearch && m_parentScene.ExternalChecks.ExternalChecksCanMoveObject(objid,user))
1497 { 1499 {
1498 obj.RemFlag(LLObject.ObjectFlags.JointWheel); 1500 obj.RemFlag(LLObject.ObjectFlags.JointWheel);
1499 } 1501 }
@@ -1526,7 +1528,7 @@ namespace OpenSim.Region.Environment.Scenes
1526 1528
1527 if (originPrim != null) 1529 if (originPrim != null)
1528 { 1530 {
1529 if (m_parentScene.Permissions.CanCopyObject(AgentID, originPrim.UUID)) 1531 if (m_parentScene.ExternalChecks.ExternalChecksCanCopyObject(originPrim.Children.Count, originPrim.UUID, AgentID, originPrim.AbsolutePosition))
1530 { 1532 {
1531 SceneObjectGroup copy = originPrim.Copy(AgentID, GroupID); 1533 SceneObjectGroup copy = originPrim.Copy(AgentID, GroupID);
1532 copy.AbsolutePosition = copy.AbsolutePosition + offset; 1534 copy.AbsolutePosition = copy.AbsolutePosition + offset;
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index b536048..e78ad2b 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -73,7 +73,7 @@ namespace OpenSim.Region.Environment.Scenes
73 remoteClient.SendInventoryItemCreateUpdate(item); 73 remoteClient.SendInventoryItemCreateUpdate(item);
74 74
75 int userlevel = 0; 75 int userlevel = 0;
76 if (Permissions.IsEstateManager(remoteClient.AgentId)) 76 if (ExternalChecks.ExternalChecksCanBeGodLike(remoteClient.AgentId))
77 { 77 {
78 userlevel = 1; 78 userlevel = 1;
79 } 79 }
@@ -988,13 +988,11 @@ namespace OpenSim.Region.Environment.Scenes
988 bool permission; 988 bool permission;
989 if (DeRezPacket.AgentBlock.Destination == 1) 989 if (DeRezPacket.AgentBlock.Destination == 1)
990 { // Take Copy 990 { // Take Copy
991 permission = Permissions.CanCopyObject(remoteClient.AgentId, 991 permission = ExternalChecks.ExternalChecksCanTakeObject(((SceneObjectGroup)selectedEnt).UUID, remoteClient.AgentId);
992 ((SceneObjectGroup) selectedEnt).UUID);
993 } 992 }
994 else 993 else
995 { // Take 994 { // Take
996 permission = Permissions.CanDeRezObject(remoteClient.AgentId, 995 permission = ExternalChecks.ExternalChecksCanTakeObject(((SceneObjectGroup)selectedEnt).UUID, remoteClient.AgentId);
997 ((SceneObjectGroup) selectedEnt).UUID);
998 } 996 }
999 997
1000 if (permission) 998 if (permission)
@@ -1285,7 +1283,7 @@ namespace OpenSim.Region.Environment.Scenes
1285 { 1283 {
1286 string xmlData = Helpers.FieldToUTF8String(rezAsset.Data); 1284 string xmlData = Helpers.FieldToUTF8String(rezAsset.Data);
1287 SceneObjectGroup group = new SceneObjectGroup(this, m_regionHandle, xmlData); 1285 SceneObjectGroup group = new SceneObjectGroup(this, m_regionHandle, xmlData);
1288 if (!Permissions.CanRezObject(remoteClient.AgentId, pos, group.Children.Count) && !attachment) 1286 if (!ExternalChecks.ExternalChecksCanRezObject(group.Children.Count,remoteClient.AgentId, pos) && !attachment)
1289 { 1287 {
1290 return null; 1288 return null;
1291 } 1289 }
@@ -1371,7 +1369,7 @@ namespace OpenSim.Region.Environment.Scenes
1371 string xmlData = Helpers.FieldToUTF8String(rezAsset.Data); 1369 string xmlData = Helpers.FieldToUTF8String(rezAsset.Data);
1372 SceneObjectGroup group = new SceneObjectGroup(this, m_regionHandle, xmlData); 1370 SceneObjectGroup group = new SceneObjectGroup(this, m_regionHandle, xmlData);
1373 1371
1374 if (!Permissions.CanRezObject(ownerID, pos, group.Children.Count)) 1372 if (!ExternalChecks.ExternalChecksCanRezObject(group.Children.Count, ownerID, pos))
1375 { 1373 {
1376 return null; 1374 return null;
1377 } 1375 }
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
index fb043b7..f55d822 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
@@ -85,7 +85,7 @@ namespace OpenSim.Region.Environment.Scenes
85 if (((SceneObjectGroup) ent).LocalId == primLocalID) 85 if (((SceneObjectGroup) ent).LocalId == primLocalID)
86 { 86 {
87 // A prim is only tainted if it's allowed to be edited by the person clicking it. 87 // A prim is only tainted if it's allowed to be edited by the person clicking it.
88 if (Permissions.CanEditObjectPosition(remoteClient.AgentId, ((SceneObjectGroup)ent).UUID) || Permissions.CanEditObject(remoteClient.AgentId, ((SceneObjectGroup)ent).UUID)) 88 if (ExternalChecks.ExternalChecksCanEditObject(((SceneObjectGroup)ent).UUID, remoteClient.AgentId) || ExternalChecks.ExternalChecksCanMoveObject(((SceneObjectGroup)ent).UUID, remoteClient.AgentId))
89 { 89 {
90 ((SceneObjectGroup) ent).GetProperties(remoteClient); 90 ((SceneObjectGroup) ent).GetProperties(remoteClient);
91 ((SceneObjectGroup) ent).IsSelected = true; 91 ((SceneObjectGroup) ent).IsSelected = true;
@@ -112,7 +112,7 @@ namespace OpenSim.Region.Environment.Scenes
112 { 112 {
113 if (((SceneObjectGroup) ent).LocalId == primLocalID) 113 if (((SceneObjectGroup) ent).LocalId == primLocalID)
114 { 114 {
115 if (Permissions.CanEditObjectPosition(remoteClient.AgentId, ((SceneObjectGroup)ent).UUID) || Permissions.CanEditObject(remoteClient.AgentId, ((SceneObjectGroup)ent).UUID)) 115 if (ExternalChecks.ExternalChecksCanEditObject(((SceneObjectGroup)ent).UUID, remoteClient.AgentId) || ExternalChecks.ExternalChecksCanMoveObject(((SceneObjectGroup)ent).UUID, remoteClient.AgentId))
116 { 116 {
117 ((SceneObjectGroup) ent).IsSelected = false; 117 ((SceneObjectGroup) ent).IsSelected = false;
118 LandChannel.SetPrimsTainted(); 118 LandChannel.SetPrimsTainted();
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index ebbfece..5ce3c7b 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -1245,7 +1245,7 @@ namespace OpenSim.Region.Environment.Scenes
1245 1245
1246 LLVector3 pos = GetNewRezLocation(RayStart, RayEnd, RayTargetID, rot, bypassRaycast, RayEndIsIntersection, true, new LLVector3(0.5f,0.5f,0.5f), false); 1246 LLVector3 pos = GetNewRezLocation(RayStart, RayEnd, RayTargetID, rot, bypassRaycast, RayEndIsIntersection, true, new LLVector3(0.5f,0.5f,0.5f), false);
1247 1247
1248 if (Permissions.CanRezObject(ownerID, pos, 1)) 1248 if ( ExternalChecks.ExternalChecksCanRezObject(1,ownerID,pos))
1249 { 1249 {
1250 // rez ON the ground, not IN the ground 1250 // rez ON the ground, not IN the ground
1251 pos.Z += 0.25F; 1251 pos.Z += 0.25F;
@@ -2519,7 +2519,7 @@ namespace OpenSim.Region.Environment.Scenes
2519 if (m_scenePresences.ContainsKey(agentID)) 2519 if (m_scenePresences.ContainsKey(agentID))
2520 { 2520 {
2521 // First check that this is the sim owner 2521 // First check that this is the sim owner
2522 if (Permissions.GenericEstatePermission(agentID)) 2522 if (ExternalChecks.ExternalChecksCanBeGodLike(agentID))
2523 { 2523 {
2524 // Next we check for spoofing..... 2524 // Next we check for spoofing.....
2525 LLUUID testSessionID = m_scenePresences[agentID].ControllingClient.SessionId; 2525 LLUUID testSessionID = m_scenePresences[agentID].ControllingClient.SessionId;
@@ -2597,7 +2597,7 @@ namespace OpenSim.Region.Environment.Scenes
2597 { 2597 {
2598 if (m_scenePresences.ContainsKey(agentID) || agentID == kickUserID) 2598 if (m_scenePresences.ContainsKey(agentID) || agentID == kickUserID)
2599 { 2599 {
2600 if (Permissions.GenericEstatePermission(godID)) 2600 if (ExternalChecks.ExternalChecksCanBeGodLike(godID))
2601 { 2601 {
2602 if (agentID == kickUserID) 2602 if (agentID == kickUserID)
2603 { 2603 {
@@ -2918,7 +2918,7 @@ namespace OpenSim.Region.Environment.Scenes
2918 } 2918 }
2919 else if ((parcel.landData.landFlags & (uint)Parcel.ParcelFlags.AllowGroupScripts) != 0) 2919 else if ((parcel.landData.landFlags & (uint)Parcel.ParcelFlags.AllowGroupScripts) != 0)
2920 { 2920 {
2921 if (part.OwnerID == parcel.landData.ownerID || (parcel.landData.isGroupOwned && part.GroupID == parcel.landData.groupID) || Permissions.GenericEstatePermission(part.OwnerID)) 2921 if (part.OwnerID == parcel.landData.ownerID || (parcel.landData.isGroupOwned && part.GroupID == parcel.landData.groupID) || ExternalChecks.ExternalChecksCanBeGodLike(part.OwnerID))
2922 { 2922 {
2923 return true; 2923 return true;
2924 } 2924 }
diff --git a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs
index 2d3e8e4..4e579b6 100644
--- a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs
@@ -30,6 +30,7 @@ using System.Collections.Generic;
30using System.Text; 30using System.Text;
31using libsecondlife; 31using libsecondlife;
32using OpenSim.Framework; 32using OpenSim.Framework;
33using OpenSim.Region.Environment.Interfaces;
33 34
34namespace OpenSim.Region.Environment.Scenes 35namespace OpenSim.Region.Environment.Scenes
35{ 36{
@@ -42,63 +43,563 @@ namespace OpenSim.Region.Environment.Scenes
42 m_scene = scene; 43 m_scene = scene;
43 } 44 }
44 45
45 #region REZ OBJECT 46 #region Object Permission Checks
46 public delegate bool CanRezObject(int objectCount, LLUUID owner, IScene scene, LLVector3 objectPosition);
47 private List<CanRezObject> CanRezObjectCheckFunctions = new List<CanRezObject>();
48 47
49 public void addCheckRezObject(CanRezObject delegateFunc) 48 #region REZ OBJECT
50 { 49 public delegate bool CanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition, Scene scene);
51 if(!CanRezObjectCheckFunctions.Contains(delegateFunc)) 50 private List<CanRezObject> CanRezObjectCheckFunctions = new List<CanRezObject>();
52 CanRezObjectCheckFunctions.Add(delegateFunc);
53 }
54 public void removeCheckRezObject(CanRezObject delegateFunc)
55 {
56 if (CanRezObjectCheckFunctions.Contains(delegateFunc))
57 CanRezObjectCheckFunctions.Remove(delegateFunc);
58 }
59 51
60 public bool ExternalChecksCanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition) 52 public void addCheckRezObject(CanRezObject delegateFunc)
61 { 53 {
62 foreach (CanRezObject check in CanRezObjectCheckFunctions) 54 if(!CanRezObjectCheckFunctions.Contains(delegateFunc))
55 CanRezObjectCheckFunctions.Add(delegateFunc);
56 }
57 public void removeCheckRezObject(CanRezObject delegateFunc)
58 {
59 if (CanRezObjectCheckFunctions.Contains(delegateFunc))
60 CanRezObjectCheckFunctions.Remove(delegateFunc);
61 }
62
63 public bool ExternalChecksCanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition)
63 { 64 {
64 if (check(objectCount, owner, m_scene, objectPosition) == false) 65 foreach (CanRezObject check in CanRezObjectCheckFunctions)
65 { 66 {
66 return false; 67 if (check(objectCount, owner,objectPosition, m_scene) == false)
68 {
69 return false;
70 }
67 } 71 }
72 return true;
68 } 73 }
69 return true; 74
70 } 75 #endregion
76
77 #region DEREZ OBJECT
78 public delegate bool CanDeRezObject(LLUUID objectID, LLUUID deleter, Scene scene);
79 private List<CanDeRezObject> CanDeRezObjectCheckFunctions = new List<CanDeRezObject>();
80
81 public void addCheckDeRezObject(CanDeRezObject delegateFunc)
82 {
83 if (!CanDeRezObjectCheckFunctions.Contains(delegateFunc))
84 CanDeRezObjectCheckFunctions.Add(delegateFunc);
85 }
86 public void removeCheckDeRezObject(CanDeRezObject delegateFunc)
87 {
88 if (CanDeRezObjectCheckFunctions.Contains(delegateFunc))
89 CanDeRezObjectCheckFunctions.Remove(delegateFunc);
90 }
91
92 public bool ExternalChecksCanDeRezObject(LLUUID objectID, LLUUID deleter)
93 {
94 foreach (CanDeRezObject check in CanDeRezObjectCheckFunctions)
95 {
96 if (check(objectID,deleter,m_scene) == false)
97 {
98 return false;
99 }
100 }
101 return true;
102 }
103
104 #endregion
105
106 #region TAKE OBJECT
107 public delegate bool CanTakeObject(LLUUID objectID, LLUUID stealer, Scene scene);
108 private List<CanTakeObject> CanTakeObjectCheckFunctions = new List<CanTakeObject>();
109
110 public void addCheckTakeObject(CanTakeObject delegateFunc)
111 {
112 if (!CanTakeObjectCheckFunctions.Contains(delegateFunc))
113 CanTakeObjectCheckFunctions.Add(delegateFunc);
114 }
115 public void removeCheckTakeObject(CanTakeObject delegateFunc)
116 {
117 if (CanTakeObjectCheckFunctions.Contains(delegateFunc))
118 CanTakeObjectCheckFunctions.Remove(delegateFunc);
119 }
120
121 public bool ExternalChecksCanTakeObject(LLUUID objectID, LLUUID stealer)
122 {
123 foreach (CanTakeObject check in CanTakeObjectCheckFunctions)
124 {
125 if (check(objectID, stealer, m_scene) == false)
126 {
127 return false;
128 }
129 }
130 return true;
131 }
132
133 #endregion
134
135 #region COPY OBJECT
136 public delegate bool CanCopyObject(int objectCount, LLUUID objectID, LLUUID owner, Scene scene, LLVector3 objectPosition);
137 private List<CanCopyObject> CanCopyObjectCheckFunctions = new List<CanCopyObject>();
138
139 public void addCheckCopyObject(CanCopyObject delegateFunc)
140 {
141 if (!CanCopyObjectCheckFunctions.Contains(delegateFunc))
142 CanCopyObjectCheckFunctions.Add(delegateFunc);
143 }
144 public void removeCheckCopyObject(CanCopyObject delegateFunc)
145 {
146 if (CanCopyObjectCheckFunctions.Contains(delegateFunc))
147 CanCopyObjectCheckFunctions.Remove(delegateFunc);
148 }
149
150 public bool ExternalChecksCanCopyObject(int objectCount, LLUUID objectID, LLUUID owner, LLVector3 objectPosition)
151 {
152 foreach (CanCopyObject check in CanCopyObjectCheckFunctions)
153 {
154 if (check(objectCount, objectID, owner, m_scene, objectPosition) == false)
155 {
156 return false;
157 }
158 }
159 return true;
160 }
161
162 #endregion
163
164 #region EDIT OBJECT
165 public delegate bool CanEditObject(LLUUID objectID, LLUUID editorID, Scene scene);
166 private List<CanEditObject> CanEditObjectCheckFunctions = new List<CanEditObject>();
167
168 public void addCheckEditObject(CanEditObject delegateFunc)
169 {
170 if (!CanEditObjectCheckFunctions.Contains(delegateFunc))
171 CanEditObjectCheckFunctions.Add(delegateFunc);
172 }
173 public void removeCheckEditObject(CanEditObject delegateFunc)
174 {
175 if (CanEditObjectCheckFunctions.Contains(delegateFunc))
176 CanEditObjectCheckFunctions.Remove(delegateFunc);
177 }
178
179 public bool ExternalChecksCanEditObject(LLUUID objectID, LLUUID editorID)
180 {
181 foreach (CanEditObject check in CanEditObjectCheckFunctions)
182 {
183 if (check(objectID, editorID, m_scene) == false)
184 {
185 return false;
186 }
187 }
188 return true;
189 }
190
191 #endregion
192
193 #region MOVE OBJECT
194 public delegate bool CanMoveObject(LLUUID objectID, LLUUID moverID, Scene scene);
195 private List<CanMoveObject> CanMoveObjectCheckFunctions = new List<CanMoveObject>();
196
197 public void addCheckMoveObject(CanMoveObject delegateFunc)
198 {
199 if (!CanMoveObjectCheckFunctions.Contains(delegateFunc))
200 CanMoveObjectCheckFunctions.Add(delegateFunc);
201 }
202 public void removeCheckMoveObject(CanMoveObject delegateFunc)
203 {
204 if (CanMoveObjectCheckFunctions.Contains(delegateFunc))
205 CanMoveObjectCheckFunctions.Remove(delegateFunc);
206 }
207
208 public bool ExternalChecksCanMoveObject(LLUUID objectID, LLUUID moverID)
209 {
210 foreach (CanMoveObject check in CanMoveObjectCheckFunctions)
211 {
212 if (check(objectID,moverID,m_scene) == false)
213 {
214 return false;
215 }
216 }
217 return true;
218 }
219
220 #endregion
221
222 #region RETURN OBJECT
223 public delegate bool CanReturnObject(LLUUID objectID, LLUUID returnerID, Scene scene);
224 private List<CanReturnObject> CanReturnObjectCheckFunctions = new List<CanReturnObject>();
225
226 public void addCheckReturnObject(CanReturnObject delegateFunc)
227 {
228 if (!CanReturnObjectCheckFunctions.Contains(delegateFunc))
229 CanReturnObjectCheckFunctions.Add(delegateFunc);
230 }
231 public void removeCheckReturnObject(CanReturnObject delegateFunc)
232 {
233 if (CanReturnObjectCheckFunctions.Contains(delegateFunc))
234 CanReturnObjectCheckFunctions.Remove(delegateFunc);
235 }
236
237 public bool ExternalChecksCanReturnObject(LLUUID objectID, LLUUID returnerID)
238 {
239 foreach (CanReturnObject check in CanReturnObjectCheckFunctions)
240 {
241 if (check(objectID,returnerID,m_scene) == false)
242 {
243 return false;
244 }
245 }
246 return true;
247 }
248
249 #endregion
71 250
72 #endregion 251 #endregion
73 252
74 #region RUN SCRIPT 253 #region Misc Permission Checks
75 public delegate bool CanRunScript(LLUUID script, LLUUID owner, IScene scene);
76 private List<CanRunScript> CanRunScriptCheckFunctions = new List<CanRunScript>();
77 254
78 public void addCheckRunScript(CanRunScript delegateFunc) 255 #region INSTANT MESSAGE
79 { 256 public delegate bool CanInstantMessage(LLUUID user, LLUUID target, Scene startScene);
80 if (!CanRunScriptCheckFunctions.Contains(delegateFunc)) 257 private List<CanInstantMessage> CanInstantMessageCheckFunctions = new List<CanInstantMessage>();
81 CanRunScriptCheckFunctions.Add(delegateFunc);
82 }
83 public void removeCheckRunScript(CanRunScript delegateFunc)
84 {
85 if (CanRunScriptCheckFunctions.Contains(delegateFunc))
86 CanRunScriptCheckFunctions.Remove(delegateFunc);
87 }
88 258
89 public bool ExternalChecksCanRunScript(LLUUID script, LLUUID owner) 259 public void addCheckInstantMessage(CanInstantMessage delegateFunc)
90 { 260 {
91 foreach (CanRunScript check in CanRunScriptCheckFunctions) 261 if (!CanInstantMessageCheckFunctions.Contains(delegateFunc))
262 CanInstantMessageCheckFunctions.Add(delegateFunc);
263 }
264 public void removeCheckInstantMessage(CanInstantMessage delegateFunc)
265 {
266 if (CanInstantMessageCheckFunctions.Contains(delegateFunc))
267 CanInstantMessageCheckFunctions.Remove(delegateFunc);
268 }
269
270 public bool ExternalChecksCanInstantMessage(LLUUID user, LLUUID target)
92 { 271 {
93 if (check(script,owner,m_scene) == false) 272 foreach (CanInstantMessage check in CanInstantMessageCheckFunctions)
94 { 273 {
95 return false; 274 if (check(user,target,m_scene) == false)
275 {
276 return false;
277 }
96 } 278 }
279 return true;
97 } 280 }
98 return true; 281
99 } 282 #endregion
283
284 #region INVENTORY TRANSFER
285 public delegate bool CanInventoryTransfer(LLUUID user, LLUUID target, Scene startScene);
286 private List<CanInventoryTransfer> CanInventoryTransferCheckFunctions = new List<CanInventoryTransfer>();
287
288 public void addCheckInventoryTransfer(CanInventoryTransfer delegateFunc)
289 {
290 if (!CanInventoryTransferCheckFunctions.Contains(delegateFunc))
291 CanInventoryTransferCheckFunctions.Add(delegateFunc);
292 }
293 public void removeCheckInventoryTransfer(CanInventoryTransfer delegateFunc)
294 {
295 if (CanInventoryTransferCheckFunctions.Contains(delegateFunc))
296 CanInventoryTransferCheckFunctions.Remove(delegateFunc);
297 }
298
299 public bool ExternalChecksCanInventoryTransfer(LLUUID user, LLUUID target)
300 {
301 foreach (CanInventoryTransfer check in CanInventoryTransferCheckFunctions)
302 {
303 if (check(user, target, m_scene) == false)
304 {
305 return false;
306 }
307 }
308 return true;
309 }
310
311 #endregion
312
313 #region EDIT SCRIPT
314 public delegate bool CanEditScript(LLUUID script, LLUUID user, Scene scene);
315 private List<CanEditScript> CanEditScriptCheckFunctions = new List<CanEditScript>();
316
317 public void addCheckEditScript(CanEditScript delegateFunc)
318 {
319 if (!CanEditScriptCheckFunctions.Contains(delegateFunc))
320 CanEditScriptCheckFunctions.Add(delegateFunc);
321 }
322 public void removeCheckEditScript(CanEditScript delegateFunc)
323 {
324 if (CanEditScriptCheckFunctions.Contains(delegateFunc))
325 CanEditScriptCheckFunctions.Remove(delegateFunc);
326 }
327
328 public bool ExternalChecksCanEditScript(LLUUID script, LLUUID user)
329 {
330 foreach (CanEditScript check in CanEditScriptCheckFunctions)
331 {
332 if (check(script, user, m_scene) == false)
333 {
334 return false;
335 }
336 }
337 return true;
338 }
339
340 #endregion
341
342 #region RUN SCRIPT
343 public delegate bool CanRunScript(LLUUID script, LLUUID user, Scene scene);
344 private List<CanRunScript> CanRunScriptCheckFunctions = new List<CanRunScript>();
345
346 public void addCheckRunScript(CanRunScript delegateFunc)
347 {
348 if (!CanRunScriptCheckFunctions.Contains(delegateFunc))
349 CanRunScriptCheckFunctions.Add(delegateFunc);
350 }
351 public void removeCheckRunScript(CanRunScript delegateFunc)
352 {
353 if (CanRunScriptCheckFunctions.Contains(delegateFunc))
354 CanRunScriptCheckFunctions.Remove(delegateFunc);
355 }
356
357 public bool ExternalChecksCanRunScript(LLUUID script, LLUUID user)
358 {
359 foreach (CanRunScript check in CanRunScriptCheckFunctions)
360 {
361 if (check(script, user, m_scene) == false)
362 {
363 return false;
364 }
365 }
366 return true;
367 }
368
369 #endregion
370
371 #region TERRAFORM LAND
372 public delegate bool CanTerraformLandCommand(LLUUID user, LLVector3 position, Scene requestFromScene);
373 private List<CanTerraformLandCommand> CanTerraformLandCommandCheckFunctions = new List<CanTerraformLandCommand>();
374
375 public void addCheckTerraformLandCommand(CanTerraformLandCommand delegateFunc)
376 {
377 if (!CanTerraformLandCommandCheckFunctions.Contains(delegateFunc))
378 CanTerraformLandCommandCheckFunctions.Add(delegateFunc);
379 }
380 public void removeCheckTerraformLandCommand(CanTerraformLandCommand delegateFunc)
381 {
382 if (CanTerraformLandCommandCheckFunctions.Contains(delegateFunc))
383 CanTerraformLandCommandCheckFunctions.Remove(delegateFunc);
384 }
385
386 public bool ExternalChecksCanTerraformLand(LLUUID user, LLVector3 pos)
387 {
388 foreach (CanTerraformLandCommand check in CanTerraformLandCommandCheckFunctions)
389 {
390 if (check(user, pos, m_scene) == false)
391 {
392 return false;
393 }
394 }
395 return true;
396 }
397
398 #endregion
399
400 #region RUN CONSOLE COMMAND
401 public delegate bool CanRunConsoleCommand(LLUUID user, Scene requestFromScene);
402 private List<CanRunConsoleCommand> CanRunConsoleCommandCheckFunctions = new List<CanRunConsoleCommand>();
403
404 public void addCheckRunConsoleCommand(CanRunConsoleCommand delegateFunc)
405 {
406 if (!CanRunConsoleCommandCheckFunctions.Contains(delegateFunc))
407 CanRunConsoleCommandCheckFunctions.Add(delegateFunc);
408 }
409 public void removeCheckRunConsoleCommand(CanRunConsoleCommand delegateFunc)
410 {
411 if (CanRunConsoleCommandCheckFunctions.Contains(delegateFunc))
412 CanRunConsoleCommandCheckFunctions.Remove(delegateFunc);
413 }
414
415 public bool ExternalChecksCanRunConsoleCommand(LLUUID user)
416 {
417 foreach (CanRunConsoleCommand check in CanRunConsoleCommandCheckFunctions)
418 {
419 if (check(user, m_scene) == false)
420 {
421 return false;
422 }
423 }
424 return true;
425 }
426
427 #endregion
428
429 #region CAN BE GODLIKE
430 public delegate bool CanBeGodLike(LLUUID user, Scene requestFromScene);
431 private List<CanBeGodLike> CanBeGodLikeCheckFunctions = new List<CanBeGodLike>();
432
433 public void addCheckBeGodLike(CanBeGodLike delegateFunc)
434 {
435 if (!CanBeGodLikeCheckFunctions.Contains(delegateFunc))
436 CanBeGodLikeCheckFunctions.Add(delegateFunc);
437 }
438 public void removeCheckBeGodLike(CanBeGodLike delegateFunc)
439 {
440 if (CanBeGodLikeCheckFunctions.Contains(delegateFunc))
441 CanBeGodLikeCheckFunctions.Remove(delegateFunc);
442 }
443
444 public bool ExternalChecksCanBeGodLike(LLUUID user)
445 {
446 foreach (CanBeGodLike check in CanBeGodLikeCheckFunctions)
447 {
448 if (check(user, m_scene) == false)
449 {
450 return false;
451 }
452 }
453 return true;
454 }
455
456 #endregion
100 457
101 #endregion 458 #endregion
102 459
460 #region Parcel and Estate Permission Checks
461 #region EDIT ESTATE TERRAIN
462 public delegate bool CanEditEstateTerrain(LLUUID user, Scene scene);
463 private List<CanEditEstateTerrain> CanEditEstateTerrainCheckFunctions = new List<CanEditEstateTerrain>();
464
465 public void addCheckEditEstateTerrain(CanEditEstateTerrain delegateFunc)
466 {
467 if (!CanEditEstateTerrainCheckFunctions.Contains(delegateFunc))
468 CanEditEstateTerrainCheckFunctions.Add(delegateFunc);
469 }
470 public void removeCheckEditEstateTerrain(CanEditEstateTerrain delegateFunc)
471 {
472 if (CanEditEstateTerrainCheckFunctions.Contains(delegateFunc))
473 CanEditEstateTerrainCheckFunctions.Remove(delegateFunc);
474 }
475
476 public bool ExternalChecksCanEditEstateTerrain(LLUUID user)
477 {
478 foreach (CanEditEstateTerrain check in CanEditEstateTerrainCheckFunctions)
479 {
480 if (check(user, m_scene) == false)
481 {
482 return false;
483 }
484 }
485 return true;
486 }
487
488 #endregion
489
490 #region RESTART SIM
491 public delegate bool CanRestartSim(LLUUID user, Scene scene);
492 private List<CanRestartSim> CanRestartSimCheckFunctions = new List<CanRestartSim>();
493
494 public void addCheckRestartSim(CanRestartSim delegateFunc)
495 {
496 if (!CanRestartSimCheckFunctions.Contains(delegateFunc))
497 CanRestartSimCheckFunctions.Add(delegateFunc);
498 }
499 public void removeCheckRestartSim(CanRestartSim delegateFunc)
500 {
501 if (CanRestartSimCheckFunctions.Contains(delegateFunc))
502 CanRestartSimCheckFunctions.Remove(delegateFunc);
503 }
504
505 public bool ExternalChecksCanRestartSim(LLUUID user)
506 {
507 foreach (CanRestartSim check in CanRestartSimCheckFunctions)
508 {
509 if (check(user, m_scene) == false)
510 {
511 return false;
512 }
513 }
514 return true;
515 }
516 #endregion
517
518 #region EDIT PARCEL
519 public delegate bool CanEditParcel(LLUUID user, ILandObject parcel, Scene scene);
520 private List<CanEditParcel> CanEditParcelCheckFunctions = new List<CanEditParcel>();
521
522 public void addCheckEditParcel(CanEditParcel delegateFunc)
523 {
524 if (!CanEditParcelCheckFunctions.Contains(delegateFunc))
525 CanEditParcelCheckFunctions.Add(delegateFunc);
526 }
527 public void removeCheckEditParcel(CanEditParcel delegateFunc)
528 {
529 if (CanEditParcelCheckFunctions.Contains(delegateFunc))
530 CanEditParcelCheckFunctions.Remove(delegateFunc);
531 }
532
533 public bool ExternalChecksCanEditParcel(LLUUID user, ILandObject parcel)
534 {
535 foreach (CanEditParcel check in CanEditParcelCheckFunctions)
536 {
537 if (check(user, parcel, m_scene) == false)
538 {
539 return false;
540 }
541 }
542 return true;
543 }
544 #endregion
545
546 #region SELL PARCEL
547 public delegate bool CanSellParcel(LLUUID user, ILandObject parcel, Scene scene);
548 private List<CanSellParcel> CanSellParcelCheckFunctions = new List<CanSellParcel>();
549
550 public void addCheckSellParcel(CanSellParcel delegateFunc)
551 {
552 if (!CanSellParcelCheckFunctions.Contains(delegateFunc))
553 CanSellParcelCheckFunctions.Add(delegateFunc);
554 }
555 public void removeCheckSellParcel(CanSellParcel delegateFunc)
556 {
557 if (CanSellParcelCheckFunctions.Contains(delegateFunc))
558 CanSellParcelCheckFunctions.Remove(delegateFunc);
559 }
560
561 public bool ExternalChecksCanSellParcel(LLUUID user, ILandObject parcel)
562 {
563 foreach (CanSellParcel check in CanSellParcelCheckFunctions)
564 {
565 if (check(user, parcel, m_scene) == false)
566 {
567 return false;
568 }
569 }
570 return true;
571 }
572 #endregion
573
574 #region ABANDON PARCEL
575 public delegate bool CanAbandonParcel(LLUUID user, ILandObject parcel, Scene scene);
576 private List<CanAbandonParcel> CanAbandonParcelCheckFunctions = new List<CanAbandonParcel>();
577
578 public void addCheckAbandonParcel(CanAbandonParcel delegateFunc)
579 {
580 if (!CanAbandonParcelCheckFunctions.Contains(delegateFunc))
581 CanAbandonParcelCheckFunctions.Add(delegateFunc);
582 }
583 public void removeCheckAbandonParcel(CanAbandonParcel delegateFunc)
584 {
585 if (CanAbandonParcelCheckFunctions.Contains(delegateFunc))
586 CanAbandonParcelCheckFunctions.Remove(delegateFunc);
587 }
588
589 public bool ExternalChecksCanAbandonParcel(LLUUID user, ILandObject parcel)
590 {
591 foreach (CanAbandonParcel check in CanAbandonParcelCheckFunctions)
592 {
593 if (check(user, parcel, m_scene) == false)
594 {
595 return false;
596 }
597 }
598 return true;
599 }
600 #endregion
601 #endregion
602
603
103 } 604 }
104} 605}