aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/PermissionManager.cs
diff options
context:
space:
mode:
authorlbsa712007-12-27 21:41:48 +0000
committerlbsa712007-12-27 21:41:48 +0000
commitefd90b56b761219af6425b1c7a2cdd3b6ffb4de2 (patch)
treebf5b897e1e3c13211e3e2fc61d30508b94c928c0 /OpenSim/Region/Environment/PermissionManager.cs
parent* removed always true if (diff)
downloadopensim-SC_OLD-efd90b56b761219af6425b1c7a2cdd3b6ffb4de2.zip
opensim-SC_OLD-efd90b56b761219af6425b1c7a2cdd3b6ffb4de2.tar.gz
opensim-SC_OLD-efd90b56b761219af6425b1c7a2cdd3b6ffb4de2.tar.bz2
opensim-SC_OLD-efd90b56b761219af6425b1c7a2cdd3b6ffb4de2.tar.xz
* Optimized usings
* shortened references * Removed redundant 'this' * Normalized EOF
Diffstat (limited to 'OpenSim/Region/Environment/PermissionManager.cs')
-rw-r--r--OpenSim/Region/Environment/PermissionManager.cs31
1 files changed, 16 insertions, 15 deletions
diff --git a/OpenSim/Region/Environment/PermissionManager.cs b/OpenSim/Region/Environment/PermissionManager.cs
index 53fa08a..76601ec 100644
--- a/OpenSim/Region/Environment/PermissionManager.cs
+++ b/OpenSim/Region/Environment/PermissionManager.cs
@@ -35,13 +35,13 @@ namespace OpenSim.Region.Environment
35 public class PermissionManager 35 public class PermissionManager
36 { 36 {
37 protected Scene m_scene; 37 protected Scene m_scene;
38 38
39 // These are here for testing. They will be taken out 39 // These are here for testing. They will be taken out
40 private uint PERM_ALL = (uint)2147483647; 40 private uint PERM_ALL = (uint) 2147483647;
41 private uint PERM_COPY = (uint)32768; 41 private uint PERM_COPY = (uint) 32768;
42 private uint PERM_MODIFY = (uint)16384; 42 private uint PERM_MODIFY = (uint) 16384;
43 private uint PERM_MOVE = (uint)524288; 43 private uint PERM_MOVE = (uint) 524288;
44 private uint PERM_TRANS = (uint)8192; 44 private uint PERM_TRANS = (uint) 8192;
45 // Bypasses the permissions engine (always returns OK) 45 // Bypasses the permissions engine (always returns OK)
46 // disable in any production environment 46 // disable in any production environment
47 // TODO: Change this to false when permissions are a desired default 47 // TODO: Change this to false when permissions are a desired default
@@ -109,10 +109,11 @@ namespace OpenSim.Region.Environment
109 109
110 string reason = "Insufficient permission"; 110 string reason = "Insufficient permission";
111 111
112 Land land = this.m_scene.LandManager.getLandObject(position.X, position.Y); 112 Land land = m_scene.LandManager.getLandObject(position.X, position.Y);
113 if (land == null) return false; 113 if (land == null) return false;
114 114
115 if ((land.landData.landFlags & ((int)Parcel.ParcelFlags.CreateObjects)) == (int)Parcel.ParcelFlags.CreateObjects) 115 if ((land.landData.landFlags & ((int) Parcel.ParcelFlags.CreateObjects)) ==
116 (int) Parcel.ParcelFlags.CreateObjects)
116 permission = true; 117 permission = true;
117 118
118 //TODO: check for group rights 119 //TODO: check for group rights
@@ -143,8 +144,6 @@ namespace OpenSim.Region.Environment
143 144
144 #region Object Permissions 145 #region Object Permissions
145 146
146
147
148 public virtual uint GenerateClientFlags(LLUUID user, LLUUID objID) 147 public virtual uint GenerateClientFlags(LLUUID user, LLUUID objID)
149 { 148 {
150 if (!m_scene.Entities.ContainsKey(objID)) 149 if (!m_scene.Entities.ContainsKey(objID))
@@ -158,7 +157,7 @@ namespace OpenSim.Region.Environment
158 return 0; 157 return 0;
159 } 158 }
160 159
161 SceneObjectGroup task = (SceneObjectGroup)m_scene.Entities[objID]; 160 SceneObjectGroup task = (SceneObjectGroup) m_scene.Entities[objID];
162 LLUUID taskOwner = null; 161 LLUUID taskOwner = null;
163 // Added this because at this point in time it wouldn't be wise for 162 // Added this because at this point in time it wouldn't be wise for
164 // the administrator object permissions to take effect. 163 // the administrator object permissions to take effect.
@@ -274,7 +273,7 @@ namespace OpenSim.Region.Environment
274 273
275 public virtual bool CanEditObjectPosition(LLUUID user, LLUUID obj) 274 public virtual bool CanEditObjectPosition(LLUUID user, LLUUID obj)
276 { 275 {
277 bool permission = GenericObjectPermission(user,obj); 276 bool permission = GenericObjectPermission(user, obj);
278 if (!permission) 277 if (!permission)
279 { 278 {
280 if (!m_scene.Entities.ContainsKey(obj)) 279 if (!m_scene.Entities.ContainsKey(obj))
@@ -288,7 +287,7 @@ namespace OpenSim.Region.Environment
288 return false; 287 return false;
289 } 288 }
290 289
291 SceneObjectGroup task = (SceneObjectGroup)m_scene.Entities[obj]; 290 SceneObjectGroup task = (SceneObjectGroup) m_scene.Entities[obj];
292 LLUUID taskOwner = null; 291 LLUUID taskOwner = null;
293 // Added this because at this point in time it wouldn't be wise for 292 // Added this because at this point in time it wouldn't be wise for
294 // the administrator object permissions to take effect. 293 // the administrator object permissions to take effect.
@@ -298,6 +297,7 @@ namespace OpenSim.Region.Environment
298 } 297 }
299 return permission; 298 return permission;
300 } 299 }
300
301 public virtual bool CanCopyObject(LLUUID user, LLUUID obj) 301 public virtual bool CanCopyObject(LLUUID user, LLUUID obj)
302 { 302 {
303 bool permission = GenericObjectPermission(user, obj); 303 bool permission = GenericObjectPermission(user, obj);
@@ -314,7 +314,7 @@ namespace OpenSim.Region.Environment
314 return false; 314 return false;
315 } 315 }
316 316
317 SceneObjectGroup task = (SceneObjectGroup)m_scene.Entities[obj]; 317 SceneObjectGroup task = (SceneObjectGroup) m_scene.Entities[obj];
318 LLUUID taskOwner = null; 318 LLUUID taskOwner = null;
319 // Added this because at this point in time it wouldn't be wise for 319 // Added this because at this point in time it wouldn't be wise for
320 // the administrator object permissions to take effect. 320 // the administrator object permissions to take effect.
@@ -324,6 +324,7 @@ namespace OpenSim.Region.Environment
324 } 324 }
325 return permission; 325 return permission;
326 } 326 }
327
327 public virtual bool CanReturnObject(LLUUID user, LLUUID obj) 328 public virtual bool CanReturnObject(LLUUID user, LLUUID obj)
328 { 329 {
329 return GenericObjectPermission(user, obj); 330 return GenericObjectPermission(user, obj);
@@ -491,4 +492,4 @@ namespace OpenSim.Region.Environment
491 492
492 #endregion 493 #endregion
493 } 494 }
494} 495} \ No newline at end of file