diff options
author | Adam Frisby | 2007-08-15 14:10:26 +0000 |
---|---|---|
committer | Adam Frisby | 2007-08-15 14:10:26 +0000 |
commit | 5699bb2e64766da634ca4be34bc2d8eab991f2e1 (patch) | |
tree | cf471be738a0ac69cf6a7a17b0a53183a7bfe68f /OpenSim/Region/Environment/Scenes | |
parent | Partial fix for the permissions on edited notecards/scripts (now you might st... (diff) | |
download | opensim-SC_OLD-5699bb2e64766da634ca4be34bc2d8eab991f2e1.zip opensim-SC_OLD-5699bb2e64766da634ca4be34bc2d8eab991f2e1.tar.gz opensim-SC_OLD-5699bb2e64766da634ca4be34bc2d8eab991f2e1.tar.bz2 opensim-SC_OLD-5699bb2e64766da634ca4be34bc2d8eab991f2e1.tar.xz |
* Permissions! - You can now only perform certain functions (such as editing other peoples objects) if you have permission to do so.
* Moved OnPermissionError to EventManager - now triggers a standard blue alert.
* Terraforming now requires permission via the permissions manager. [Defaults to admin-only]
* Permissions manager is now substantiated in Scene
* Buttload of new permissions added.
* Estate manager operations now require various levels of permission to operate
* OGS1 now produces 'summary reports' for a commsManager of each scene it maintains connections for. Reduces grid network traffic for ping checks.
* Added new "permissions true" / "permissions false" console command to enable or disable permissions.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs | 42 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 16 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneEvents.cs | 9 |
3 files changed, 52 insertions, 15 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs index bba0138..cca8998 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs | |||
@@ -50,6 +50,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
50 | /// <param name="west">Distance from the west border where the cursor is located</param> | 50 | /// <param name="west">Distance from the west border where the cursor is located</param> |
51 | public void ModifyTerrain(float height, float seconds, byte brushsize, byte action, float north, float west, IClientAPI remoteUser) | 51 | public void ModifyTerrain(float height, float seconds, byte brushsize, byte action, float north, float west, IClientAPI remoteUser) |
52 | { | 52 | { |
53 | // Do a permissions check before allowing terraforming. | ||
54 | // random users are now no longer allowed to terraform | ||
55 | // if permissions are enabled. | ||
56 | if (!PermissionsMngr.CanTerraform(remoteUser.AgentId, new LLVector3(north, west, 0))) | ||
57 | return; | ||
58 | |||
53 | // Shiny. | 59 | // Shiny. |
54 | double size = (double)(1 << brushsize); | 60 | double size = (double)(1 << brushsize); |
55 | 61 | ||
@@ -240,15 +246,18 @@ namespace OpenSim.Region.Environment.Scenes | |||
240 | } | 246 | } |
241 | if (selectedEnt != null) | 247 | if (selectedEnt != null) |
242 | { | 248 | { |
243 | List<ScenePresence> avatars = this.RequestAvatarList(); | 249 | if (PermissionsMngr.CanDeRezObject(simClient.AgentId, selectedEnt.m_uuid)) |
244 | foreach (ScenePresence avatar in avatars) | ||
245 | { | ||
246 | avatar.ControllingClient.SendKillObject(this.m_regionHandle, selectedEnt.LocalId); | ||
247 | } | ||
248 | |||
249 | lock (Entities) | ||
250 | { | 250 | { |
251 | Entities.Remove(selectedEnt.m_uuid); | 251 | List<ScenePresence> avatars = this.RequestAvatarList(); |
252 | foreach (ScenePresence avatar in avatars) | ||
253 | { | ||
254 | avatar.ControllingClient.SendKillObject(this.m_regionHandle, selectedEnt.LocalId); | ||
255 | } | ||
256 | |||
257 | lock (Entities) | ||
258 | { | ||
259 | Entities.Remove(selectedEnt.m_uuid); | ||
260 | } | ||
252 | } | 261 | } |
253 | } | 262 | } |
254 | } | 263 | } |
@@ -501,16 +510,19 @@ namespace OpenSim.Region.Environment.Scenes | |||
501 | 510 | ||
502 | public void MoveObject(LLUUID objectID, LLVector3 offset, LLVector3 pos, IClientAPI remoteClient) | 511 | public void MoveObject(LLUUID objectID, LLVector3 offset, LLVector3 pos, IClientAPI remoteClient) |
503 | { | 512 | { |
504 | bool hasPrim = false; | 513 | if (PermissionsMngr.CanEditObject(remoteClient.AgentId, objectID)) |
505 | foreach (EntityBase ent in Entities.Values) | ||
506 | { | 514 | { |
507 | if (ent is SceneObjectGroup) | 515 | bool hasPrim = false; |
516 | foreach (EntityBase ent in Entities.Values) | ||
508 | { | 517 | { |
509 | hasPrim = ((SceneObjectGroup)ent).HasChildPrim(objectID); | 518 | if (ent is SceneObjectGroup) |
510 | if (hasPrim != false) | ||
511 | { | 519 | { |
512 | ((SceneObjectGroup)ent).GrabMovement(offset, pos, remoteClient); | 520 | hasPrim = ((SceneObjectGroup)ent).HasChildPrim(objectID); |
513 | break; | 521 | if (hasPrim != false) |
522 | { | ||
523 | ((SceneObjectGroup)ent).GrabMovement(offset, pos, remoteClient); | ||
524 | break; | ||
525 | } | ||
514 | } | 526 | } |
515 | } | 527 | } |
516 | } | 528 | } |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 6c87c5d..0fa3ab7 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -110,6 +110,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
110 | get { return m_scriptManager; } | 110 | get { return m_scriptManager; } |
111 | } | 111 | } |
112 | 112 | ||
113 | private PermissionManager m_permissionManager; | ||
114 | |||
115 | public PermissionManager PermissionsMngr | ||
116 | { | ||
117 | get { return m_permissionManager; } | ||
118 | } | ||
119 | |||
113 | public Dictionary<LLUUID, SceneObjectGroup> Objects | 120 | public Dictionary<LLUUID, SceneObjectGroup> Objects |
114 | { | 121 | { |
115 | get { return Prims; } | 122 | get { return Prims; } |
@@ -143,10 +150,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
143 | m_estateManager = new EstateManager(this, m_regInfo); | 150 | m_estateManager = new EstateManager(this, m_regInfo); |
144 | m_scriptManager = new ScriptManager(this); | 151 | m_scriptManager = new ScriptManager(this); |
145 | m_eventManager = new EventManager(); | 152 | m_eventManager = new EventManager(); |
153 | m_permissionManager = new PermissionManager(this); | ||
146 | 154 | ||
147 | m_eventManager.OnParcelPrimCountAdd += | 155 | m_eventManager.OnParcelPrimCountAdd += |
148 | m_LandManager.addPrimToLandPrimCounts; | 156 | m_LandManager.addPrimToLandPrimCounts; |
149 | 157 | ||
158 | m_eventManager.OnPermissionError += SendPermissionAlert; | ||
159 | |||
150 | MainLog.Instance.Verbose("Creating new entitities instance"); | 160 | MainLog.Instance.Verbose("Creating new entitities instance"); |
151 | Entities = new Dictionary<LLUUID, EntityBase>(); | 161 | Entities = new Dictionary<LLUUID, EntityBase>(); |
152 | Avatars = new Dictionary<LLUUID, ScenePresence>(); | 162 | Avatars = new Dictionary<LLUUID, ScenePresence>(); |
@@ -966,6 +976,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
966 | #endregion | 976 | #endregion |
967 | 977 | ||
968 | #region Alert Methods | 978 | #region Alert Methods |
979 | |||
980 | void SendPermissionAlert(LLUUID user, string reason) | ||
981 | { | ||
982 | SendAlertToUser(user, reason, false); | ||
983 | } | ||
984 | |||
969 | public void SendGeneralAlert(string message) | 985 | public void SendGeneralAlert(string message) |
970 | { | 986 | { |
971 | foreach (ScenePresence presence in this.Avatars.Values) | 987 | foreach (ScenePresence presence in this.Avatars.Values) |
diff --git a/OpenSim/Region/Environment/Scenes/SceneEvents.cs b/OpenSim/Region/Environment/Scenes/SceneEvents.cs index cb5a967..050207c 100644 --- a/OpenSim/Region/Environment/Scenes/SceneEvents.cs +++ b/OpenSim/Region/Environment/Scenes/SceneEvents.cs | |||
@@ -33,7 +33,16 @@ namespace OpenSim.Region.Environment.Scenes | |||
33 | public event OnShutdownDelegate OnShutdown; | 33 | public event OnShutdownDelegate OnShutdown; |
34 | 34 | ||
35 | public delegate void ObjectGrabDelegate(uint localID, LLVector3 offsetPos, IClientAPI remoteClient); | 35 | public delegate void ObjectGrabDelegate(uint localID, LLVector3 offsetPos, IClientAPI remoteClient); |
36 | public delegate void OnPermissionErrorDelegate(LLUUID user, string reason); | ||
36 | public event ObjectGrabDelegate OnObjectGrab; | 37 | public event ObjectGrabDelegate OnObjectGrab; |
38 | public event OnPermissionErrorDelegate OnPermissionError; | ||
39 | |||
40 | |||
41 | public void TriggerPermissionError(LLUUID user, string reason) | ||
42 | { | ||
43 | if (OnPermissionError != null) | ||
44 | OnPermissionError(user, reason); | ||
45 | } | ||
37 | 46 | ||
38 | public void TriggerOnScriptConsole(string[] args) | 47 | public void TriggerOnScriptConsole(string[] args) |
39 | { | 48 | { |