aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/PermissionManager.cs
diff options
context:
space:
mode:
authorlbsa712007-09-19 00:30:55 +0000
committerlbsa712007-09-19 00:30:55 +0000
commit8f0b03597b0bc8ea6873af9a55495407fae1ec56 (patch)
treef9f4de38379aebf2223ad4cb10a3d9ebcfa52a4f /OpenSim/Region/Environment/PermissionManager.cs
parent* Moved SendLogoutPacket back to IClientAPI. (diff)
downloadopensim-SC_OLD-8f0b03597b0bc8ea6873af9a55495407fae1ec56.zip
opensim-SC_OLD-8f0b03597b0bc8ea6873af9a55495407fae1ec56.tar.gz
opensim-SC_OLD-8f0b03597b0bc8ea6873af9a55495407fae1ec56.tar.bz2
opensim-SC_OLD-8f0b03597b0bc8ea6873af9a55495407fae1ec56.tar.xz
* Modernized ScriptManager to new interface-based module calls.
* 'remove redundant this qualifier' ftw
Diffstat (limited to 'OpenSim/Region/Environment/PermissionManager.cs')
-rw-r--r--OpenSim/Region/Environment/PermissionManager.cs38
1 files changed, 16 insertions, 22 deletions
diff --git a/OpenSim/Region/Environment/PermissionManager.cs b/OpenSim/Region/Environment/PermissionManager.cs
index cb455f4..0a33380 100644
--- a/OpenSim/Region/Environment/PermissionManager.cs
+++ b/OpenSim/Region/Environment/PermissionManager.cs
@@ -1,14 +1,7 @@
1using System.Collections.Generic; 1using libsecondlife;
2using OpenSim.Framework; 2using OpenSim.Region.Environment.LandManagement;
3using OpenSim.Framework.Types; 3using OpenSim.Region.Environment.Scenes;
4using OpenSim.Framework.Communications; 4
5using OpenSim.Framework.Servers;
6using OpenSim.Region.Capabilities;
7using OpenSim.Region.Environment.Scenes;
8using OpenSim.Region.Environment.LandManagement;
9
10using libsecondlife;
11
12namespace OpenSim.Region.Environment 5namespace OpenSim.Region.Environment
13{ 6{
14 public class PermissionManager 7 public class PermissionManager
@@ -19,7 +12,8 @@ namespace OpenSim.Region.Environment
19 // disable in any production environment 12 // disable in any production environment
20 // TODO: Change this to false when permissions are a desired default 13 // TODO: Change this to false when permissions are a desired default
21 // TODO: Move to configuration option. 14 // TODO: Move to configuration option.
22 private bool m_bypassPermissions = true; 15 private bool m_bypassPermissions = true;
16
23 public bool BypassPermissions 17 public bool BypassPermissions
24 { 18 {
25 get { return m_bypassPermissions; } 19 get { return m_bypassPermissions; }
@@ -104,26 +98,27 @@ namespace OpenSim.Region.Environment
104 // Default: deny 98 // Default: deny
105 bool permission = false; 99 bool permission = false;
106 100
107 if( !m_scene.Entities.ContainsKey( objId )) 101 if (!m_scene.Entities.ContainsKey(objId))
108 { 102 {
109 return false; 103 return false;
110 } 104 }
111 105
112 // If it's not an object, we cant edit it. 106 // If it's not an object, we cant edit it.
113 if (!(m_scene.Entities[objId] is SceneObjectGroup)) 107 if (!(m_scene.Entities[objId] is SceneObjectGroup))
114 { 108 {
115 return false; 109 return false;
116 } 110 }
117 111
118 SceneObjectGroup task = (SceneObjectGroup)m_scene.Entities[objId]; 112 SceneObjectGroup task = (SceneObjectGroup) m_scene.Entities[objId];
119 LLUUID taskOwner = null; 113 LLUUID taskOwner = null;
120 114
121 // Object owners should be able to edit their own content 115 // Object owners should be able to edit their own content
122 if (user == taskOwner) 116 if (user == taskOwner)
123 permission = true; 117 permission = true;
124 118
125 // Users should be able to edit what is over their land. 119 // Users should be able to edit what is over their land.
126 if (m_scene.LandManager.getLandObject(task.AbsolutePosition.X, task.AbsolutePosition.Y).landData.ownerID == user) 120 if (m_scene.LandManager.getLandObject(task.AbsolutePosition.X, task.AbsolutePosition.Y).landData.ownerID ==
121 user)
127 permission = true; 122 permission = true;
128 123
129 // Estate users should be able to edit anything in the sim 124 // Estate users should be able to edit anything in the sim
@@ -270,7 +265,7 @@ namespace OpenSim.Region.Environment
270 // TODO: Need to do some extra checks here. Requires group code. 265 // TODO: Need to do some extra checks here. Requires group code.
271 } 266 }
272 267
273 if(IsEstateManager(user)) 268 if (IsEstateManager(user))
274 permission = true; 269 permission = true;
275 270
276 if (IsAdministrator(user)) 271 if (IsAdministrator(user))
@@ -299,7 +294,6 @@ namespace OpenSim.Region.Environment
299 return GenericParcelPermission(user, parcel); 294 return GenericParcelPermission(user, parcel);
300 } 295 }
301 296
302 #endregion 297 #endregion
303
304 } 298 }
305} 299} \ No newline at end of file