diff options
author | Justin Clarke Casey | 2008-05-05 20:14:53 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-05-05 20:14:53 +0000 |
commit | 9655cf280779021e6241a08f8610cad9b982763f (patch) | |
tree | 82ef6d74969e4b64971d64a6a18e4488729167a8 /OpenSim/Region/Environment/Scenes | |
parent | * Just some tidy up and documentation before I make my first ever attempt to ... (diff) | |
download | opensim-SC-9655cf280779021e6241a08f8610cad9b982763f.zip opensim-SC-9655cf280779021e6241a08f8610cad9b982763f.tar.gz opensim-SC-9655cf280779021e6241a08f8610cad9b982763f.tar.bz2 opensim-SC-9655cf280779021e6241a08f8610cad9b982763f.tar.xz |
* Refactor: Break out permissions code into a separate region PermissionsModule
Diffstat (limited to 'OpenSim/Region/Environment/Scenes')
7 files changed, 48 insertions, 50 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; |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index ee52a66..65e6fd8 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 (PermissionsMngr.IsEstateManager(remoteClient.AgentId)) | 76 | if (Permissions.IsEstateManager(remoteClient.AgentId)) |
77 | { | 77 | { |
78 | userlevel = 1; | 78 | userlevel = 1; |
79 | } | 79 | } |
@@ -784,7 +784,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
784 | } | 784 | } |
785 | 785 | ||
786 | // bool permission; | 786 | // bool permission; |
787 | // permission = PermissionsMngr.CanCopyObject(remoteClient.AgentId, | 787 | // permission = Permissions.CanCopyObject(remoteClient.AgentId, |
788 | // ((SceneObjectGroup) selectedEnt).UUID); | 788 | // ((SceneObjectGroup) selectedEnt).UUID); |
789 | 789 | ||
790 | // Pending resolving upstream problems with permissions, we just won't allow anybody who is not the owner | 790 | // Pending resolving upstream problems with permissions, we just won't allow anybody who is not the owner |
@@ -988,12 +988,12 @@ 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 = PermissionsMngr.CanCopyObject(remoteClient.AgentId, | 991 | permission = Permissions.CanCopyObject(remoteClient.AgentId, |
992 | ((SceneObjectGroup) selectedEnt).UUID); | 992 | ((SceneObjectGroup) selectedEnt).UUID); |
993 | } | 993 | } |
994 | else | 994 | else |
995 | { // Take | 995 | { // Take |
996 | permission = PermissionsMngr.CanDeRezObject(remoteClient.AgentId, | 996 | permission = Permissions.CanDeRezObject(remoteClient.AgentId, |
997 | ((SceneObjectGroup) selectedEnt).UUID); | 997 | ((SceneObjectGroup) selectedEnt).UUID); |
998 | } | 998 | } |
999 | 999 | ||
@@ -1267,7 +1267,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1267 | RayStart, RayEnd, RayTargetID, new LLQuaternion(0, 0, 0, 1), | 1267 | RayStart, RayEnd, RayTargetID, new LLQuaternion(0, 0, 0, 1), |
1268 | BypassRayCast, bRayEndIsIntersection,true,scale, false); | 1268 | BypassRayCast, bRayEndIsIntersection,true,scale, false); |
1269 | 1269 | ||
1270 | if (!PermissionsMngr.CanRezObject(remoteClient.AgentId, pos) && !attachment) | 1270 | if (!Permissions.CanRezObject(remoteClient.AgentId, pos) && !attachment) |
1271 | { | 1271 | { |
1272 | return null; | 1272 | return null; |
1273 | } | 1273 | } |
@@ -1361,7 +1361,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1361 | { | 1361 | { |
1362 | LLUUID ownerID = item.OwnerID; | 1362 | LLUUID ownerID = item.OwnerID; |
1363 | 1363 | ||
1364 | if (!PermissionsMngr.CanRezObject(ownerID, pos)) | 1364 | if (!Permissions.CanRezObject(ownerID, pos)) |
1365 | { | 1365 | { |
1366 | return null; | 1366 | return null; |
1367 | } | 1367 | } |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs index b4a581d..350990e 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 (m_permissionManager.CanEditObjectPosition(remoteClient.AgentId, ((SceneObjectGroup)ent).UUID) || m_permissionManager.CanEditObject(remoteClient.AgentId, ((SceneObjectGroup)ent).UUID)) | 88 | if (Permissions.CanEditObjectPosition(remoteClient.AgentId, ((SceneObjectGroup)ent).UUID) || Permissions.CanEditObject(remoteClient.AgentId, ((SceneObjectGroup)ent).UUID)) |
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 (m_permissionManager.CanEditObjectPosition(remoteClient.AgentId, ((SceneObjectGroup)ent).UUID) || m_permissionManager.CanEditObject(remoteClient.AgentId, ((SceneObjectGroup)ent).UUID)) | 115 | if (Permissions.CanEditObjectPosition(remoteClient.AgentId, ((SceneObjectGroup)ent).UUID) || Permissions.CanEditObject(remoteClient.AgentId, ((SceneObjectGroup)ent).UUID)) |
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 f861361..a703622 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -114,6 +114,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
114 | protected IXMLRPC m_xmlrpcModule; | 114 | protected IXMLRPC m_xmlrpcModule; |
115 | protected IWorldComm m_worldCommModule; | 115 | protected IWorldComm m_worldCommModule; |
116 | protected IAvatarFactory m_AvatarFactory; | 116 | protected IAvatarFactory m_AvatarFactory; |
117 | protected IScenePermissions m_permissions; | ||
117 | 118 | ||
118 | // Central Update Loop | 119 | // Central Update Loop |
119 | 120 | ||
@@ -169,13 +170,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
169 | get { return m_timedilation; } | 170 | get { return m_timedilation; } |
170 | } | 171 | } |
171 | 172 | ||
172 | protected readonly PermissionManager m_permissionManager; | 173 | /// <summary> |
173 | // This is the instance to the permissions manager. | 174 | /// The reference by which general permissions in the scene can be set and queried. |
174 | // This manages permissions to clients on in world objects | 175 | /// </summary> |
175 | 176 | public IScenePermissions Permissions | |
176 | public PermissionManager PermissionsMngr | ||
177 | { | 177 | { |
178 | get { return m_permissionManager; } | 178 | get { return m_permissions; } |
179 | } | 179 | } |
180 | 180 | ||
181 | public int TimePhase | 181 | public int TimePhase |
@@ -219,7 +219,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
219 | 219 | ||
220 | #region Constructors | 220 | #region Constructors |
221 | 221 | ||
222 | public Scene(RegionInfo regInfo, AgentCircuitManager authen, PermissionManager permissionManager, | 222 | public Scene(RegionInfo regInfo, AgentCircuitManager authen, |
223 | CommunicationsManager commsMan, SceneCommunicationService sceneGridService, | 223 | CommunicationsManager commsMan, SceneCommunicationService sceneGridService, |
224 | AssetCache assetCach, StorageManager storeManager, BaseHttpServer httpServer, | 224 | AssetCache assetCach, StorageManager storeManager, BaseHttpServer httpServer, |
225 | ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim, bool SeeIntoRegionFromNeighbor) | 225 | ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim, bool SeeIntoRegionFromNeighbor) |
@@ -248,10 +248,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
248 | EventManager.OnLandObjectRemoved += | 248 | EventManager.OnLandObjectRemoved += |
249 | new EventManager.LandObjectRemoved(m_storageManager.DataStore.RemoveLandObject); | 249 | new EventManager.LandObjectRemoved(m_storageManager.DataStore.RemoveLandObject); |
250 | 250 | ||
251 | m_permissionManager = permissionManager; | 251 | m_innerScene = new InnerScene(this, m_regInfo); |
252 | m_permissionManager.Initialise(this); | ||
253 | |||
254 | m_innerScene = new InnerScene(this, m_regInfo, m_permissionManager); | ||
255 | 252 | ||
256 | // If the Inner scene has an Unrecoverable error, restart this sim. | 253 | // If the Inner scene has an Unrecoverable error, restart this sim. |
257 | // Currently the only thing that causes it to happen is two kinds of specific | 254 | // Currently the only thing that causes it to happen is two kinds of specific |
@@ -613,6 +610,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
613 | m_heartbeatTimer.Elapsed += new ElapsedEventHandler(Heartbeat); | 610 | m_heartbeatTimer.Elapsed += new ElapsedEventHandler(Heartbeat); |
614 | } | 611 | } |
615 | 612 | ||
613 | /// <summary> | ||
614 | /// Sets up references to loaded modules required by thie scene | ||
615 | /// </summary> | ||
616 | public void SetModuleInterfaces() | 616 | public void SetModuleInterfaces() |
617 | { | 617 | { |
618 | m_simChatModule = RequestModuleInterface<ISimChat>(); | 618 | m_simChatModule = RequestModuleInterface<ISimChat>(); |
@@ -621,6 +621,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
621 | m_worldCommModule = RequestModuleInterface<IWorldComm>(); | 621 | m_worldCommModule = RequestModuleInterface<IWorldComm>(); |
622 | XferManager = RequestModuleInterface<IXfer>(); | 622 | XferManager = RequestModuleInterface<IXfer>(); |
623 | m_AvatarFactory = RequestModuleInterface<IAvatarFactory>(); | 623 | m_AvatarFactory = RequestModuleInterface<IAvatarFactory>(); |
624 | m_permissions = RequestModuleInterface<IScenePermissions>(); | ||
624 | } | 625 | } |
625 | 626 | ||
626 | #endregion | 627 | #endregion |
@@ -1121,7 +1122,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1121 | /// <summary> | 1122 | /// <summary> |
1122 | /// Loads the World's objects | 1123 | /// Loads the World's objects |
1123 | /// </summary> | 1124 | /// </summary> |
1124 | public virtual void LoadPrimsFromStorage(bool m_permissions, LLUUID regionID) | 1125 | public virtual void LoadPrimsFromStorage(LLUUID regionID) |
1125 | { | 1126 | { |
1126 | m_log.Info("[SCENE]: Loading objects from datastore"); | 1127 | m_log.Info("[SCENE]: Loading objects from datastore"); |
1127 | 1128 | ||
@@ -1243,12 +1244,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
1243 | 1244 | ||
1244 | LLVector3 pos = GetNewRezLocation(RayStart, RayEnd, RayTargetID, rot, bypassRaycast, RayEndIsIntersection, true, new LLVector3(0.5f,0.5f,0.5f), false); | 1245 | LLVector3 pos = GetNewRezLocation(RayStart, RayEnd, RayTargetID, rot, bypassRaycast, RayEndIsIntersection, true, new LLVector3(0.5f,0.5f,0.5f), false); |
1245 | 1246 | ||
1246 | if (PermissionsMngr.CanRezObject(ownerID, pos)) | 1247 | if (Permissions.CanRezObject(ownerID, pos)) |
1247 | { | 1248 | { |
1248 | // rez ON the ground, not IN the ground | 1249 | // rez ON the ground, not IN the ground |
1249 | pos.Z += 0.25F; | 1250 | pos.Z += 0.25F; |
1250 | 1251 | ||
1251 | |||
1252 | AddNewPrim(ownerID, pos, rot, shape); | 1252 | AddNewPrim(ownerID, pos, rot, shape); |
1253 | } | 1253 | } |
1254 | } | 1254 | } |
@@ -2499,7 +2499,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2499 | IClientAPI controllingClient) | 2499 | IClientAPI controllingClient) |
2500 | { | 2500 | { |
2501 | // First check that this is the sim owner | 2501 | // First check that this is the sim owner |
2502 | if (m_permissionManager.GenericEstatePermission(agentID)) | 2502 | if (Permissions.GenericEstatePermission(agentID)) |
2503 | { | 2503 | { |
2504 | // User needs to be logged into this sim | 2504 | // User needs to be logged into this sim |
2505 | if (m_scenePresences.ContainsKey(agentID)) | 2505 | if (m_scenePresences.ContainsKey(agentID)) |
@@ -2577,7 +2577,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2577 | LLUUID kickUserID = new LLUUID("44e87126e7944ded05b37c42da3d5cdb"); | 2577 | LLUUID kickUserID = new LLUUID("44e87126e7944ded05b37c42da3d5cdb"); |
2578 | if (m_scenePresences.ContainsKey(agentID) || agentID == kickUserID) | 2578 | if (m_scenePresences.ContainsKey(agentID) || agentID == kickUserID) |
2579 | { | 2579 | { |
2580 | if (m_permissionManager.GenericEstatePermission(godID)) | 2580 | if (Permissions.GenericEstatePermission(godID)) |
2581 | { | 2581 | { |
2582 | if (agentID == kickUserID) | 2582 | if (agentID == kickUserID) |
2583 | { | 2583 | { |
@@ -2896,7 +2896,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2896 | } | 2896 | } |
2897 | else if ((parcel.landData.landFlags & (uint)Parcel.ParcelFlags.AllowGroupScripts) != 0) | 2897 | else if ((parcel.landData.landFlags & (uint)Parcel.ParcelFlags.AllowGroupScripts) != 0) |
2898 | { | 2898 | { |
2899 | if (part.OwnerID == parcel.landData.ownerID || (parcel.landData.isGroupOwned && part.GroupID == parcel.landData.groupID) || PermissionsMngr.GenericEstatePermission(part.OwnerID)) | 2899 | if (part.OwnerID == parcel.landData.ownerID || (parcel.landData.isGroupOwned && part.GroupID == parcel.landData.groupID) || Permissions.GenericEstatePermission(part.OwnerID)) |
2900 | { | 2900 | { |
2901 | return true; | 2901 | return true; |
2902 | } | 2902 | } |
diff --git a/OpenSim/Region/Environment/Scenes/SceneManager.cs b/OpenSim/Region/Environment/Scenes/SceneManager.cs index 2dfea2a..8603ccc 100644 --- a/OpenSim/Region/Environment/Scenes/SceneManager.cs +++ b/OpenSim/Region/Environment/Scenes/SceneManager.cs | |||
@@ -191,7 +191,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
191 | 191 | ||
192 | public void SetBypassPermissionsOnCurrentScene(bool bypassPermissions) | 192 | public void SetBypassPermissionsOnCurrentScene(bool bypassPermissions) |
193 | { | 193 | { |
194 | ForEachCurrentScene(delegate(Scene scene) { scene.PermissionsMngr.BypassPermissions = bypassPermissions; }); | 194 | ForEachCurrentScene(delegate(Scene scene) { scene.Permissions.BypassPermissions = bypassPermissions; }); |
195 | } | 195 | } |
196 | 196 | ||
197 | private void ForEachCurrentScene(Action<Scene> func) | 197 | private void ForEachCurrentScene(Action<Scene> func) |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 9ed5990..2e44c54 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |||
@@ -1340,7 +1340,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1340 | if (part.OwnerID != cAgentID) | 1340 | if (part.OwnerID != cAgentID) |
1341 | { | 1341 | { |
1342 | // Apply Next Owner Permissions if we're not bypassing permissions | 1342 | // Apply Next Owner Permissions if we're not bypassing permissions |
1343 | if (!m_scene.PermissionsMngr.BypassPermissions) | 1343 | if (!m_scene.Permissions.BypassPermissions) |
1344 | m_rootPart.ApplyNextOwnerPermissions(); | 1344 | m_rootPart.ApplyNextOwnerPermissions(); |
1345 | } | 1345 | } |
1346 | 1346 | ||
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 453c18f..fcd93d8 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -451,7 +451,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
451 | 451 | ||
452 | public uint GenerateClientFlags(LLUUID ObjectID) | 452 | public uint GenerateClientFlags(LLUUID ObjectID) |
453 | { | 453 | { |
454 | return m_scene.PermissionsMngr.GenerateClientFlags(m_uuid, ObjectID); | 454 | return m_scene.Permissions.GenerateClientFlags(m_uuid, ObjectID); |
455 | } | 455 | } |
456 | 456 | ||
457 | /// <summary> | 457 | /// <summary> |