aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/PermissionManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/PermissionManager.cs')
-rw-r--r--OpenSim/Region/Environment/PermissionManager.cs17
1 files changed, 11 insertions, 6 deletions
diff --git a/OpenSim/Region/Environment/PermissionManager.cs b/OpenSim/Region/Environment/PermissionManager.cs
index 37df180..53fa08a 100644
--- a/OpenSim/Region/Environment/PermissionManager.cs
+++ b/OpenSim/Region/Environment/PermissionManager.cs
@@ -110,6 +110,8 @@ namespace OpenSim.Region.Environment
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 = this.m_scene.LandManager.getLandObject(position.X, position.Y);
113 if (land == null) return false;
114
113 if ((land.landData.landFlags & ((int)Parcel.ParcelFlags.CreateObjects)) == (int)Parcel.ParcelFlags.CreateObjects) 115 if ((land.landData.landFlags & ((int)Parcel.ParcelFlags.CreateObjects)) == (int)Parcel.ParcelFlags.CreateObjects)
114 permission = true; 116 permission = true;
115 117
@@ -176,8 +178,8 @@ namespace OpenSim.Region.Environment
176 return OwnerMask; 178 return OwnerMask;
177 179
178 // Users should be able to edit what is over their land. 180 // Users should be able to edit what is over their land.
179 if (m_scene.LandManager.getLandObject(task.AbsolutePosition.X, task.AbsolutePosition.Y).landData.ownerID == 181 Land parcel = m_scene.LandManager.getLandObject(task.AbsolutePosition.X, task.AbsolutePosition.Y);
180 user) 182 if (parcel != null && parcel.landData.ownerID == user)
181 return OwnerMask; 183 return OwnerMask;
182 184
183 // Estate users should be able to edit anything in the sim 185 // Estate users should be able to edit anything in the sim
@@ -235,8 +237,8 @@ namespace OpenSim.Region.Environment
235 permission = true; 237 permission = true;
236 238
237 // Users should be able to edit what is over their land. 239 // Users should be able to edit what is over their land.
238 if (m_scene.LandManager.getLandObject(task.AbsolutePosition.X, task.AbsolutePosition.Y).landData.ownerID == 240 Land parcel = m_scene.LandManager.getLandObject(task.AbsolutePosition.X, task.AbsolutePosition.Y);
239 user) 241 if (parcel != null && parcel.landData.ownerID == user)
240 permission = true; 242 permission = true;
241 243
242 // Estate users should be able to edit anything in the sim 244 // Estate users should be able to edit anything in the sim
@@ -399,7 +401,8 @@ namespace OpenSim.Region.Environment
399 Y = 0; 401 Y = 0;
400 402
401 // Land owner can terraform too 403 // Land owner can terraform too
402 if (GenericParcelPermission(user, m_scene.LandManager.getLandObject(X, Y))) 404 Land parcel = m_scene.LandManager.getLandObject(X, Y);
405 if (parcel != null && GenericParcelPermission(user, parcel))
403 permission = true; 406 permission = true;
404 407
405 if (!permission) 408 if (!permission)
@@ -466,7 +469,9 @@ namespace OpenSim.Region.Environment
466 469
467 protected virtual bool GenericParcelPermission(LLUUID user, LLVector3 pos) 470 protected virtual bool GenericParcelPermission(LLUUID user, LLVector3 pos)
468 { 471 {
469 return GenericParcelPermission(user, m_scene.LandManager.getLandObject(pos.X, pos.Y)); 472 Land parcel = m_scene.LandManager.getLandObject(pos.X, pos.Y);
473 if (parcel == null) return false;
474 return GenericParcelPermission(user, parcel);
470 } 475 }
471 476
472 public virtual bool CanEditParcel(LLUUID user, Land parcel) 477 public virtual bool CanEditParcel(LLUUID user, Land parcel)