aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
authorAdam Frisby2007-08-04 00:56:56 +0000
committerAdam Frisby2007-08-04 00:56:56 +0000
commit3fc2d86dfe9fa041097eb33a4d7d3660c72df373 (patch)
tree19681ca3b3a1e339c4b636973f4533f981f47b37 /OpenSim/Region/Environment
parent* Little more cleaning of EstateManager - still needs packets to be moved, bu... (diff)
downloadopensim-SC-3fc2d86dfe9fa041097eb33a4d7d3660c72df373.zip
opensim-SC-3fc2d86dfe9fa041097eb33a4d7d3660c72df373.tar.gz
opensim-SC-3fc2d86dfe9fa041097eb33a4d7d3660c72df373.tar.bz2
opensim-SC-3fc2d86dfe9fa041097eb33a4d7d3660c72df373.tar.xz
* More work on PermissionManager
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/EstateManager.cs9
-rw-r--r--OpenSim/Region/Environment/PermissionManager.cs40
2 files changed, 44 insertions, 5 deletions
diff --git a/OpenSim/Region/Environment/EstateManager.cs b/OpenSim/Region/Environment/EstateManager.cs
index 67cfba6..83bfbb4 100644
--- a/OpenSim/Region/Environment/EstateManager.cs
+++ b/OpenSim/Region/Environment/EstateManager.cs
@@ -70,9 +70,8 @@ namespace OpenSim.Region.Environment
70 /// <param name="corner">Which corner</param> 70 /// <param name="corner">Which corner</param>
71 /// <param name="lowValue">Minimum height that texture range should cover</param> 71 /// <param name="lowValue">Minimum height that texture range should cover</param>
72 /// <param name="highValue">Maximum height that texture range should cover</param> 72 /// <param name="highValue">Maximum height that texture range should cover</param>
73 public void setEstateTextureRange(UInt16 corner, float lowValue, float highValue) 73 public void setEstateTextureRange(Int16 corner, float lowValue, float highValue)
74 { 74 {
75
76 switch (corner) 75 switch (corner)
77 { 76 {
78 case 0: 77 case 0:
@@ -99,7 +98,7 @@ namespace OpenSim.Region.Environment
99 /// </summary> 98 /// </summary>
100 /// <param name="band">Which texture band</param> 99 /// <param name="band">Which texture band</param>
101 /// <param name="textureUUID">The UUID of the texture</param> 100 /// <param name="textureUUID">The UUID of the texture</param>
102 public void setTerrainTexture(UInt16 band, LLUUID textureUUID) 101 public void setTerrainTexture(Int16 band, LLUUID textureUUID)
103 { 102 {
104 switch (band) 103 switch (band)
105 { 104 {
@@ -265,7 +264,7 @@ namespace OpenSim.Region.Environment
265 if (splitField.Length == 3) 264 if (splitField.Length == 3)
266 { 265 {
267 266
268 UInt16 corner = Convert.ToInt16(splitField[0]); 267 Int16 corner = Convert.ToInt16(splitField[0]);
269 float lowValue = (float)Convert.ToDecimal(splitField[1]); 268 float lowValue = (float)Convert.ToDecimal(splitField[1]);
270 float highValue = (float)Convert.ToDecimal(splitField[2]); 269 float highValue = (float)Convert.ToDecimal(splitField[2]);
271 270
@@ -283,7 +282,7 @@ namespace OpenSim.Region.Environment
283 string[] splitField = s.Split(' '); 282 string[] splitField = s.Split(' ');
284 if (splitField.Length == 2) 283 if (splitField.Length == 2)
285 { 284 {
286 UInt16 corner = Convert.ToInt16(splitField[0]); 285 Int16 corner = Convert.ToInt16(splitField[0]);
287 LLUUID textureUUID = new LLUUID(splitField[1]); 286 LLUUID textureUUID = new LLUUID(splitField[1]);
288 287
289 setTerrainTexture(corner, textureUUID); 288 setTerrainTexture(corner, textureUUID);
diff --git a/OpenSim/Region/Environment/PermissionManager.cs b/OpenSim/Region/Environment/PermissionManager.cs
index fc9e58d..e768d7f 100644
--- a/OpenSim/Region/Environment/PermissionManager.cs
+++ b/OpenSim/Region/Environment/PermissionManager.cs
@@ -20,6 +20,15 @@ namespace OpenSim.Region.Environment
20 m_scene = world; 20 m_scene = world;
21 } 21 }
22 22
23 public delegate void OnPermissionErrorDelegate(LLUUID user, string reason);
24 public event OnPermissionErrorDelegate OnPermissionError;
25
26 protected virtual void SendPermissionError(LLUUID user, string reason)
27 {
28 if (OnPermissionError != null)
29 OnPermissionError(user, reason);
30 }
31
23 protected virtual bool IsAdministrator(LLUUID user) 32 protected virtual bool IsAdministrator(LLUUID user)
24 { 33 {
25 return m_scene.RegionInfo.MasterAvatarAssignedUUID == user; 34 return m_scene.RegionInfo.MasterAvatarAssignedUUID == user;
@@ -104,5 +113,36 @@ namespace OpenSim.Region.Environment
104 { 113 {
105 return false; 114 return false;
106 } 115 }
116
117 public virtual bool CanEditEstateSettings(LLUUID user)
118 {
119 // Default: deny
120 bool canEdit = false;
121
122 // Estate admins should be able to use estate tools
123 if (IsEstateManager(user))
124 canEdit = true;
125
126 // Administrators always have permission
127 if (IsAdministrator(user))
128 canEdit = true;
129
130 return canEdit;
131 }
132
133 public virtual bool CanEditParcel(LLUUID user, Land parcel)
134 {
135 return false;
136 }
137
138 public virtual bool CanSellParcel(LLUUID user, Land parcel)
139 {
140 return false;
141 }
142
143 public virtual bool CanAbandonParcel(LLUUID user, Land parcel)
144 {
145 return false;
146 }
107 } 147 }
108} 148}