aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/InnerScene.cs
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-05-05 20:14:53 +0000
committerJustin Clarke Casey2008-05-05 20:14:53 +0000
commit9655cf280779021e6241a08f8610cad9b982763f (patch)
tree82ef6d74969e4b64971d64a6a18e4488729167a8 /OpenSim/Region/Environment/Scenes/InnerScene.cs
parent* Just some tidy up and documentation before I make my first ever attempt to ... (diff)
downloadopensim-SC_OLD-9655cf280779021e6241a08f8610cad9b982763f.zip
opensim-SC_OLD-9655cf280779021e6241a08f8610cad9b982763f.tar.gz
opensim-SC_OLD-9655cf280779021e6241a08f8610cad9b982763f.tar.bz2
opensim-SC_OLD-9655cf280779021e6241a08f8610cad9b982763f.tar.xz
* Refactor: Break out permissions code into a separate region PermissionsModule
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/InnerScene.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/InnerScene.cs42
1 files changed, 20 insertions, 22 deletions
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs
index da286ad..f29e1f3 100644
--- a/OpenSim/Region/Environment/Scenes/InnerScene.cs
+++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs
@@ -63,7 +63,6 @@ namespace OpenSim.Region.Environment.Scenes
63 63
64 protected RegionInfo m_regInfo; 64 protected RegionInfo m_regInfo;
65 protected Scene m_parentScene; 65 protected Scene m_parentScene;
66 protected PermissionManager PermissionsMngr;
67 protected List<EntityBase> m_updateList = new List<EntityBase>(); 66 protected List<EntityBase> m_updateList = new List<EntityBase>();
68 protected int m_numRootAgents = 0; 67 protected int m_numRootAgents = 0;
69 protected int m_numPrim = 0; 68 protected int m_numPrim = 0;
@@ -79,11 +78,10 @@ namespace OpenSim.Region.Environment.Scenes
79 78
80 #endregion 79 #endregion
81 80
82 public InnerScene(Scene parent, RegionInfo regInfo, PermissionManager permissionsMngr) 81 public InnerScene(Scene parent, RegionInfo regInfo)
83 { 82 {
84 m_parentScene = parent; 83 m_parentScene = parent;
85 m_regInfo = regInfo; 84 m_regInfo = regInfo;
86 PermissionsMngr = permissionsMngr;
87 QuadTree = new BasicQuadTreeNode(null, "/0/", 0, 0, (short)Constants.RegionSize, (short)Constants.RegionSize); 85 QuadTree = new BasicQuadTreeNode(null, "/0/", 0, 0, (short)Constants.RegionSize, (short)Constants.RegionSize);
88 QuadTree.Subdivide(); 86 QuadTree.Subdivide();
89 QuadTree.Subdivide(); 87 QuadTree.Subdivide();
@@ -1031,7 +1029,7 @@ namespace OpenSim.Region.Environment.Scenes
1031 SceneObjectGroup group = GetGroupByPrim(localID); 1029 SceneObjectGroup group = GetGroupByPrim(localID);
1032 if (group != null) 1030 if (group != null)
1033 { 1031 {
1034 if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID)) 1032 if (m_parentScene.Permissions.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
1035 { 1033 {
1036 group.Resize(scale, localID); 1034 group.Resize(scale, localID);
1037 } 1035 }
@@ -1042,7 +1040,7 @@ namespace OpenSim.Region.Environment.Scenes
1042 SceneObjectGroup group = GetGroupByPrim(localID); 1040 SceneObjectGroup group = GetGroupByPrim(localID);
1043 if (group != null) 1041 if (group != null)
1044 { 1042 {
1045 if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID)) 1043 if (m_parentScene.Permissions.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
1046 { 1044 {
1047 group.GroupResize(scale, localID); 1045 group.GroupResize(scale, localID);
1048 } 1046 }
@@ -1078,7 +1076,7 @@ namespace OpenSim.Region.Environment.Scenes
1078 SceneObjectGroup group = GetGroupByPrim(localID); 1076 SceneObjectGroup group = GetGroupByPrim(localID);
1079 if (group != null) 1077 if (group != null)
1080 { 1078 {
1081 if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID)) 1079 if (m_parentScene.Permissions.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
1082 { 1080 {
1083 group.UpdateSingleRotation(rot, localID); 1081 group.UpdateSingleRotation(rot, localID);
1084 } 1082 }
@@ -1096,7 +1094,7 @@ namespace OpenSim.Region.Environment.Scenes
1096 SceneObjectGroup group = GetGroupByPrim(localID); 1094 SceneObjectGroup group = GetGroupByPrim(localID);
1097 if (group != null) 1095 if (group != null)
1098 { 1096 {
1099 if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID)) 1097 if (m_parentScene.Permissions.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
1100 { 1098 {
1101 group.UpdateGroupRotation(rot); 1099 group.UpdateGroupRotation(rot);
1102 } 1100 }
@@ -1115,7 +1113,7 @@ namespace OpenSim.Region.Environment.Scenes
1115 SceneObjectGroup group = GetGroupByPrim(localID); 1113 SceneObjectGroup group = GetGroupByPrim(localID);
1116 if (group != null) 1114 if (group != null)
1117 { 1115 {
1118 if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID)) 1116 if (m_parentScene.Permissions.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
1119 { 1117 {
1120 group.UpdateGroupRotation(pos, rot); 1118 group.UpdateGroupRotation(pos, rot);
1121 } 1119 }
@@ -1128,12 +1126,12 @@ namespace OpenSim.Region.Environment.Scenes
1128 if (group != null) 1126 if (group != null)
1129 { 1127 {
1130 LLVector3 oldPos = group.AbsolutePosition; 1128 LLVector3 oldPos = group.AbsolutePosition;
1131 if (!PermissionsMngr.CanObjectEntry(remoteClient.AgentId, oldPos, pos) && !group.RootPart.m_IsAttachment) 1129 if (!m_parentScene.Permissions.CanObjectEntry(remoteClient.AgentId, oldPos, pos) && !group.RootPart.m_IsAttachment)
1132 { 1130 {
1133 group.SendGroupTerseUpdate(); 1131 group.SendGroupTerseUpdate();
1134 return; 1132 return;
1135 } 1133 }
1136 if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID) || group.RootPart.m_IsAttachment) 1134 if (m_parentScene.Permissions.CanEditObjectPosition(remoteClient.AgentId, group.UUID) || group.RootPart.m_IsAttachment)
1137 { 1135 {
1138 group.UpdateSinglePosition(pos, localID); 1136 group.UpdateSinglePosition(pos, localID);
1139 } 1137 }
@@ -1159,12 +1157,12 @@ namespace OpenSim.Region.Environment.Scenes
1159 } 1157 }
1160 else 1158 else
1161 { 1159 {
1162 if (!PermissionsMngr.CanObjectEntry(remoteClient.AgentId, oldPos, pos) && !group.RootPart.m_IsAttachment) 1160 if (!m_parentScene.Permissions.CanObjectEntry(remoteClient.AgentId, oldPos, pos) && !group.RootPart.m_IsAttachment)
1163 { 1161 {
1164 group.SendGroupTerseUpdate(); 1162 group.SendGroupTerseUpdate();
1165 return; 1163 return;
1166 } 1164 }
1167 if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID) || group.RootPart.m_IsAttachment) 1165 if (m_parentScene.Permissions.CanEditObjectPosition(remoteClient.AgentId, group.UUID) || group.RootPart.m_IsAttachment)
1168 { 1166 {
1169 group.UpdateGroupPosition(pos); 1167 group.UpdateGroupPosition(pos);
1170 } 1168 }
@@ -1183,7 +1181,7 @@ namespace OpenSim.Region.Environment.Scenes
1183 SceneObjectGroup group = GetGroupByPrim(localID); 1181 SceneObjectGroup group = GetGroupByPrim(localID);
1184 if (group != null) 1182 if (group != null)
1185 { 1183 {
1186 if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID)) 1184 if (m_parentScene.Permissions.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
1187 { 1185 {
1188 group.UpdateTextureEntry(localID, texture); 1186 group.UpdateTextureEntry(localID, texture);
1189 } 1187 }
@@ -1201,7 +1199,7 @@ namespace OpenSim.Region.Environment.Scenes
1201 SceneObjectGroup group = GetGroupByPrim(localID); 1199 SceneObjectGroup group = GetGroupByPrim(localID);
1202 if (group != null) 1200 if (group != null)
1203 { 1201 {
1204 if (PermissionsMngr.CanEditObject(remoteClient.AgentId, group.UUID)) 1202 if (m_parentScene.Permissions.CanEditObject(remoteClient.AgentId, group.UUID))
1205 { 1203 {
1206 group.UpdatePrimFlags(localID, (ushort)packet.Type, true, packet.ToBytes()); 1204 group.UpdatePrimFlags(localID, (ushort)packet.Type, true, packet.ToBytes());
1207 } 1205 }
@@ -1213,7 +1211,7 @@ namespace OpenSim.Region.Environment.Scenes
1213 SceneObjectGroup group = GetGroupByPrim(objectID); 1211 SceneObjectGroup group = GetGroupByPrim(objectID);
1214 if (group != null) 1212 if (group != null)
1215 { 1213 {
1216 if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID))// && PermissionsMngr.) 1214 if (m_parentScene.Permissions.CanEditObjectPosition(remoteClient.AgentId, group.UUID))// && PermissionsMngr.)
1217 { 1215 {
1218 group.GrabMovement(offset, pos, remoteClient); 1216 group.GrabMovement(offset, pos, remoteClient);
1219 } 1217 }
@@ -1235,7 +1233,7 @@ namespace OpenSim.Region.Environment.Scenes
1235 SceneObjectGroup group = GetGroupByPrim(primLocalID); 1233 SceneObjectGroup group = GetGroupByPrim(primLocalID);
1236 if (group != null) 1234 if (group != null)
1237 { 1235 {
1238 if (PermissionsMngr.CanEditObject(remoteClient.AgentId, group.UUID)) 1236 if (m_parentScene.Permissions.CanEditObject(remoteClient.AgentId, group.UUID))
1239 { 1237 {
1240 group.SetPartName(Util.CleanString(name), primLocalID); 1238 group.SetPartName(Util.CleanString(name), primLocalID);
1241 } 1239 }
@@ -1252,7 +1250,7 @@ namespace OpenSim.Region.Environment.Scenes
1252 SceneObjectGroup group = GetGroupByPrim(primLocalID); 1250 SceneObjectGroup group = GetGroupByPrim(primLocalID);
1253 if (group != null) 1251 if (group != null)
1254 { 1252 {
1255 if (PermissionsMngr.CanEditObject(remoteClient.AgentId, group.UUID)) 1253 if (m_parentScene.Permissions.CanEditObject(remoteClient.AgentId, group.UUID))
1256 { 1254 {
1257 group.SetPartDescription(Util.CleanString(description), primLocalID); 1255 group.SetPartDescription(Util.CleanString(description), primLocalID);
1258 } 1256 }
@@ -1265,7 +1263,7 @@ namespace OpenSim.Region.Environment.Scenes
1265 1263
1266 if (group != null) 1264 if (group != null)
1267 { 1265 {
1268 if (PermissionsMngr.CanEditObject(agentID, group.UUID)) 1266 if (m_parentScene.Permissions.CanEditObject(agentID, group.UUID))
1269 { 1267 {
1270 group.UpdateExtraParam(primLocalID, type, inUse, data); 1268 group.UpdateExtraParam(primLocalID, type, inUse, data);
1271 } 1269 }
@@ -1282,7 +1280,7 @@ namespace OpenSim.Region.Environment.Scenes
1282 SceneObjectGroup group = GetGroupByPrim(primLocalID); 1280 SceneObjectGroup group = GetGroupByPrim(primLocalID);
1283 if (group != null) 1281 if (group != null)
1284 { 1282 {
1285 if (PermissionsMngr.CanEditObjectPosition(agentID, group.GetPartsFullID(primLocalID))) 1283 if (m_parentScene.Permissions.CanEditObjectPosition(agentID, group.GetPartsFullID(primLocalID)))
1286 { 1284 {
1287 group.UpdateShape(shapeBlock, primLocalID); 1285 group.UpdateShape(shapeBlock, primLocalID);
1288 } 1286 }
@@ -1448,11 +1446,11 @@ namespace OpenSim.Region.Environment.Scenes
1448 // * Asset/DRM permission bit "modify" is enabled 1446 // * Asset/DRM permission bit "modify" is enabled
1449 //use CanEditObjectPosition 1447 //use CanEditObjectPosition
1450 1448
1451 if (IncludeInSearch && PermissionsMngr.CanEditObject(user, objid)) 1449 if (IncludeInSearch && m_parentScene.Permissions.CanEditObject(user, objid))
1452 { 1450 {
1453 obj.AddFlag(LLObject.ObjectFlags.JointWheel); 1451 obj.AddFlag(LLObject.ObjectFlags.JointWheel);
1454 } 1452 }
1455 else if (!IncludeInSearch && PermissionsMngr.CanEditObjectPosition(user, objid)) 1453 else if (!IncludeInSearch && m_parentScene.Permissions.CanEditObjectPosition(user, objid))
1456 { 1454 {
1457 obj.RemFlag(LLObject.ObjectFlags.JointWheel); 1455 obj.RemFlag(LLObject.ObjectFlags.JointWheel);
1458 } 1456 }
@@ -1485,7 +1483,7 @@ namespace OpenSim.Region.Environment.Scenes
1485 1483
1486 if (originPrim != null) 1484 if (originPrim != null)
1487 { 1485 {
1488 if (PermissionsMngr.CanCopyObject(AgentID, originPrim.UUID)) 1486 if (m_parentScene.Permissions.CanCopyObject(AgentID, originPrim.UUID))
1489 { 1487 {
1490 SceneObjectGroup copy = originPrim.Copy(AgentID, GroupID); 1488 SceneObjectGroup copy = originPrim.Copy(AgentID, GroupID);
1491 copy.AbsolutePosition = copy.AbsolutePosition + offset; 1489 copy.AbsolutePosition = copy.AbsolutePosition + offset;