aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/InnerScene.cs
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/InnerScene.cs
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/InnerScene.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/InnerScene.cs54
1 files changed, 28 insertions, 26 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;