diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs (renamed from OpenSim/Region/Environment/PermissionManager.cs) | 66 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs | 2 |
4 files changed, 38 insertions, 38 deletions
diff --git a/OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs b/OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs index 8e90d17..c7ee233 100644 --- a/OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs +++ b/OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs | |||
@@ -41,10 +41,6 @@ namespace OpenSim.Region.Environment.Modules.Agent.Xfer | |||
41 | public Dictionary<string, byte[]> NewFiles = new Dictionary<string, byte[]>(); | 41 | public Dictionary<string, byte[]> NewFiles = new Dictionary<string, byte[]>(); |
42 | public Dictionary<ulong, XferDownLoad> Transfers = new Dictionary<ulong, XferDownLoad>(); | 42 | public Dictionary<ulong, XferDownLoad> Transfers = new Dictionary<ulong, XferDownLoad>(); |
43 | 43 | ||
44 | public XferModule() | ||
45 | { | ||
46 | } | ||
47 | |||
48 | #region IRegionModule Members | 44 | #region IRegionModule Members |
49 | 45 | ||
50 | public void Initialise(Scene scene, IConfigSource config) | 46 | public void Initialise(Scene scene, IConfigSource config) |
diff --git a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs index 403ab5b..ebe0357 100644 --- a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs | |||
@@ -205,7 +205,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate | |||
205 | 205 | ||
206 | // This needs to be updated for SuperEstateOwnerUser.. a non existing user in the estatesettings.xml | 206 | // This needs to be updated for SuperEstateOwnerUser.. a non existing user in the estatesettings.xml |
207 | // So make sure you really trust your region owners. because they can add other estate manaagers to your other estates | 207 | // So make sure you really trust your region owners. because they can add other estate manaagers to your other estates |
208 | if (remote_client.AgentId == m_scene.RegionInfo.MasterAvatarAssignedUUID || m_scene.PermissionsMngr.BypassPermissions) | 208 | if (remote_client.AgentId == m_scene.RegionInfo.MasterAvatarAssignedUUID || m_scene.Permissions.BypassPermissions) |
209 | { | 209 | { |
210 | m_scene.RegionInfo.EstateSettings.AddEstateManager(user); | 210 | m_scene.RegionInfo.EstateSettings.AddEstateManager(user); |
211 | remote_client.sendEstateManagersList(invoice); | 211 | remote_client.sendEstateManagersList(invoice); |
@@ -219,7 +219,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate | |||
219 | case 512: | 219 | case 512: |
220 | // This needs to be updated for SuperEstateOwnerUser.. a non existing user in the estatesettings.xml | 220 | // This needs to be updated for SuperEstateOwnerUser.. a non existing user in the estatesettings.xml |
221 | // So make sure you really trust your region owners. because they can add other estate manaagers to your other estates | 221 | // So make sure you really trust your region owners. because they can add other estate manaagers to your other estates |
222 | if (remote_client.AgentId == m_scene.RegionInfo.MasterAvatarAssignedUUID || m_scene.PermissionsMngr.BypassPermissions) | 222 | if (remote_client.AgentId == m_scene.RegionInfo.MasterAvatarAssignedUUID || m_scene.Permissions.BypassPermissions) |
223 | { | 223 | { |
224 | m_scene.RegionInfo.EstateSettings.RemoveEstateManager(user); | 224 | m_scene.RegionInfo.EstateSettings.RemoveEstateManager(user); |
225 | remote_client.sendEstateManagersList(invoice); | 225 | remote_client.sendEstateManagersList(invoice); |
diff --git a/OpenSim/Region/Environment/PermissionManager.cs b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs index fd8387b..de02702 100644 --- a/OpenSim/Region/Environment/PermissionManager.cs +++ b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs | |||
@@ -26,12 +26,14 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using libsecondlife; | 28 | using libsecondlife; |
29 | using Nini.Config; | ||
30 | |||
29 | using OpenSim.Region.Environment.Interfaces; | 31 | using OpenSim.Region.Environment.Interfaces; |
30 | using OpenSim.Region.Environment.Scenes; | 32 | using OpenSim.Region.Environment.Scenes; |
31 | 33 | ||
32 | namespace OpenSim.Region.Environment | 34 | namespace OpenSim.Region.Environment.Modules.World.Permissions |
33 | { | 35 | { |
34 | public class PermissionManager | 36 | public class PermissionsModule : IRegionModule, IScenePermissions |
35 | { | 37 | { |
36 | protected Scene m_scene; | 38 | protected Scene m_scene; |
37 | 39 | ||
@@ -43,11 +45,9 @@ namespace OpenSim.Region.Environment | |||
43 | private uint PERM_MOVE = (uint)524288; | 45 | private uint PERM_MOVE = (uint)524288; |
44 | //private uint PERM_TRANS = (uint)8192; | 46 | //private uint PERM_TRANS = (uint)8192; |
45 | private uint PERM_LOCKED = (uint)540672; | 47 | private uint PERM_LOCKED = (uint)540672; |
46 | // Bypasses the permissions engine (always returns OK) | 48 | |
47 | // disable in any production environment | 49 | // Bypasses the permissions engine |
48 | // TODO: Change this to false when permissions are a desired default | 50 | private bool m_bypassPermissions = false; |
49 | // TODO: Move to configuration option. | ||
50 | private bool m_bypassPermissions = true; | ||
51 | 51 | ||
52 | public bool BypassPermissions | 52 | public bool BypassPermissions |
53 | { | 53 | { |
@@ -55,20 +55,40 @@ namespace OpenSim.Region.Environment | |||
55 | set { m_bypassPermissions = value; } | 55 | set { m_bypassPermissions = value; } |
56 | } | 56 | } |
57 | 57 | ||
58 | public PermissionManager() | 58 | #region IRegionModule Members |
59 | |||
60 | public void Initialise(Scene scene, IConfigSource config) | ||
59 | { | 61 | { |
62 | m_scene = scene; | ||
63 | |||
64 | // FIXME: Possibly move all permissions related stuff to its own section | ||
65 | IConfig myConfig = config.Configs["Startup"]; | ||
66 | |||
67 | m_bypassPermissions = !myConfig.GetBoolean("serverside_object_permissions", false); | ||
68 | |||
69 | m_scene.RegisterModuleInterface<IScenePermissions>(this); | ||
60 | } | 70 | } |
61 | 71 | ||
62 | public PermissionManager(Scene scene) | 72 | public void PostInitialise() |
63 | { | 73 | { |
64 | m_scene = scene; | ||
65 | } | 74 | } |
66 | 75 | ||
67 | public void Initialise(Scene scene) | 76 | public void Close() |
68 | { | 77 | { |
69 | m_scene = scene; | ||
70 | } | 78 | } |
71 | 79 | ||
80 | public string Name | ||
81 | { | ||
82 | get { return "PermissionsModule"; } | ||
83 | } | ||
84 | |||
85 | public bool IsSharedModule | ||
86 | { | ||
87 | get { return false; } | ||
88 | } | ||
89 | |||
90 | #endregion | ||
91 | |||
72 | protected virtual void SendPermissionError(LLUUID user, string reason) | 92 | protected virtual void SendPermissionError(LLUUID user, string reason) |
73 | { | 93 | { |
74 | m_scene.EventManager.TriggerPermissionError(user, reason); | 94 | m_scene.EventManager.TriggerPermissionError(user, reason); |
@@ -159,17 +179,9 @@ namespace OpenSim.Region.Environment | |||
159 | return permission; | 179 | return permission; |
160 | } | 180 | } |
161 | 181 | ||
162 | /// <summary> | 182 | /// <see cref="Opensim.Region.Environment.Interfaces.IScenePermissions></see> |
163 | /// Permissions check - can user enter an object? | ||
164 | /// </summary> | ||
165 | /// <param name="user">User attempting move an object</param> | ||
166 | /// <param name="oldPos">Source object-position</param> | ||
167 | /// <param name="newPos">Target object-position</param> | ||
168 | /// <returns>Has permission?</returns> | ||
169 | public virtual bool CanObjectEntry(LLUUID user, LLVector3 oldPos, LLVector3 newPos) | 183 | public virtual bool CanObjectEntry(LLUUID user, LLVector3 oldPos, LLVector3 newPos) |
170 | { | 184 | { |
171 | |||
172 | |||
173 | if ((newPos.X > 257f || newPos.X < -1f || newPos.Y > 257f || newPos.Y < -1f)) | 185 | if ((newPos.X > 257f || newPos.X < -1f || newPos.Y > 257f || newPos.Y < -1f)) |
174 | { | 186 | { |
175 | return true; | 187 | return true; |
@@ -214,7 +226,6 @@ namespace OpenSim.Region.Environment | |||
214 | 226 | ||
215 | public virtual uint GenerateClientFlags(LLUUID user, LLUUID objID) | 227 | public virtual uint GenerateClientFlags(LLUUID user, LLUUID objID) |
216 | { | 228 | { |
217 | |||
218 | // Here's the way this works, | 229 | // Here's the way this works, |
219 | // ObjectFlags and Permission flags are two different enumerations | 230 | // ObjectFlags and Permission flags are two different enumerations |
220 | // ObjectFlags, however, tells the client to change what it will allow the user to do. | 231 | // ObjectFlags, however, tells the client to change what it will allow the user to do. |
@@ -296,8 +307,6 @@ namespace OpenSim.Region.Environment | |||
296 | return objectEveryoneMask; | 307 | return objectEveryoneMask; |
297 | } | 308 | } |
298 | 309 | ||
299 | |||
300 | |||
301 | private uint ApplyObjectModifyMasks(uint setPermissionMask, uint objectFlagsMask) | 310 | private uint ApplyObjectModifyMasks(uint setPermissionMask, uint objectFlagsMask) |
302 | { | 311 | { |
303 | // We are adding the temporary objectflags to the object's objectflags based on the | 312 | // We are adding the temporary objectflags to the object's objectflags based on the |
@@ -395,12 +404,7 @@ namespace OpenSim.Region.Environment | |||
395 | return permission; | 404 | return permission; |
396 | } | 405 | } |
397 | 406 | ||
398 | /// <summary> | 407 | /// <see cref="Opensim.Region.Environment.Interfaces.IScenePermissions></see> |
399 | /// Permissions check - can user delete an object? | ||
400 | /// </summary> | ||
401 | /// <param name="user">User attempting the delete</param> | ||
402 | /// <param name="obj">Target object</param> | ||
403 | /// <returns>Has permission?</returns> | ||
404 | public virtual bool CanDeRezObject(LLUUID user, LLUUID obj) | 408 | public virtual bool CanDeRezObject(LLUUID user, LLUUID obj) |
405 | { | 409 | { |
406 | return GenericObjectPermission(user, obj); | 410 | return GenericObjectPermission(user, obj); |
@@ -522,7 +526,7 @@ namespace OpenSim.Region.Environment | |||
522 | 526 | ||
523 | #region Communication Permissions | 527 | #region Communication Permissions |
524 | 528 | ||
525 | public virtual bool GenericCommunicationPermission(LLUUID user, LLUUID target) | 529 | protected virtual bool GenericCommunicationPermission(LLUUID user, LLUUID target) |
526 | { | 530 | { |
527 | bool permission = false; | 531 | bool permission = false; |
528 | string reason = "Only registered users may communicate with another account."; | 532 | string reason = "Only registered users may communicate with another account."; |
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs index 240ba65..91a28e4 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs | |||
@@ -449,7 +449,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain | |||
449 | float south, float east, IClientAPI remoteClient) | 449 | float south, float east, IClientAPI remoteClient) |
450 | { | 450 | { |
451 | // Not a good permissions check, if in area mode, need to check the entire area. | 451 | // Not a good permissions check, if in area mode, need to check the entire area. |
452 | if (m_scene.PermissionsMngr.CanTerraform(remoteClient.AgentId, new LLVector3(north, west, 0))) | 452 | if (m_scene.Permissions.CanTerraform(remoteClient.AgentId, new LLVector3(north, west, 0))) |
453 | { | 453 | { |
454 | if (north == south && east == west) | 454 | if (north == south && east == west) |
455 | { | 455 | { |