diff options
author | Melanie | 2011-10-26 17:48:51 +0100 |
---|---|---|
committer | Melanie | 2011-10-26 17:48:51 +0100 |
commit | 6a96c9546d4fd89f6e9319246cc2270836cf19f7 (patch) | |
tree | e6492419b9a03cb78435e911b345b4a31f749162 /OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |
parent | Merge branch 'master' into bigmerge (diff) | |
parent | Merge branch 'master' of /home/opensim/var/repo/opensim (diff) | |
download | opensim-SC_OLD-6a96c9546d4fd89f6e9319246cc2270836cf19f7.zip opensim-SC_OLD-6a96c9546d4fd89f6e9319246cc2270836cf19f7.tar.gz opensim-SC_OLD-6a96c9546d4fd89f6e9319246cc2270836cf19f7.tar.bz2 opensim-SC_OLD-6a96c9546d4fd89f6e9319246cc2270836cf19f7.tar.xz |
Merge branch 'master' into bigmerge
Conflicts:
OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 67 |
1 files changed, 61 insertions, 6 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index ed2f221..ab0eec9 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -113,11 +113,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
113 | { | 113 | { |
114 | public List<UUID> AllowedCreators; | 114 | public List<UUID> AllowedCreators; |
115 | public List<UUID> AllowedOwners; | 115 | public List<UUID> AllowedOwners; |
116 | public List<string> AllowedOwnerClasses; | ||
116 | 117 | ||
117 | public FunctionPerms() | 118 | public FunctionPerms() |
118 | { | 119 | { |
119 | AllowedCreators = new List<UUID>(); | 120 | AllowedCreators = new List<UUID>(); |
120 | AllowedOwners = new List<UUID>(); | 121 | AllowedOwners = new List<UUID>(); |
122 | AllowedOwnerClasses = new List<string>(); | ||
121 | } | 123 | } |
122 | } | 124 | } |
123 | 125 | ||
@@ -254,6 +256,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
254 | // Default behavior | 256 | // Default behavior |
255 | perms.AllowedOwners = null; | 257 | perms.AllowedOwners = null; |
256 | perms.AllowedCreators = null; | 258 | perms.AllowedCreators = null; |
259 | perms.AllowedOwnerClasses = null; | ||
257 | } | 260 | } |
258 | else | 261 | else |
259 | { | 262 | { |
@@ -274,12 +277,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
274 | foreach (string id in ids) | 277 | foreach (string id in ids) |
275 | { | 278 | { |
276 | string current = id.Trim(); | 279 | string current = id.Trim(); |
277 | UUID uuid; | 280 | if (current.ToUpper() == "PARCEL_GROUP_MEMBER" || current.ToUpper() == "PARCEL_OWNER" || current.ToUpper() == "ESTATE_MANAGER" || current.ToUpper() == "ESTATE_OWNER") |
278 | |||
279 | if (UUID.TryParse(current, out uuid)) | ||
280 | { | 281 | { |
281 | if (uuid != UUID.Zero) | 282 | if (!perms.AllowedOwnerClasses.Contains(current)) |
282 | perms.AllowedOwners.Add(uuid); | 283 | perms.AllowedOwnerClasses.Add(current.ToUpper()); |
284 | } | ||
285 | else | ||
286 | { | ||
287 | UUID uuid; | ||
288 | |||
289 | if (UUID.TryParse(current, out uuid)) | ||
290 | { | ||
291 | if (uuid != UUID.Zero) | ||
292 | perms.AllowedOwners.Add(uuid); | ||
293 | } | ||
283 | } | 294 | } |
284 | } | 295 | } |
285 | 296 | ||
@@ -335,11 +346,55 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
335 | String.Format("{0} permission error. Can't find script in prim inventory.", | 346 | String.Format("{0} permission error. Can't find script in prim inventory.", |
336 | function)); | 347 | function)); |
337 | } | 348 | } |
349 | |||
350 | UUID ownerID = ti.OwnerID; | ||
351 | |||
352 | //OSSL only may be used if objet is in the same group as the parcel | ||
353 | if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("PARCEL_GROUP_MEMBER")) | ||
354 | { | ||
355 | ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); | ||
356 | |||
357 | if (land.LandData.GroupID == ti.GroupID && land.LandData.GroupID != UUID.Zero) | ||
358 | { | ||
359 | return; | ||
360 | } | ||
361 | } | ||
362 | |||
363 | //Only Parcelowners may use the function | ||
364 | if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("PARCEL_OWNER")) | ||
365 | { | ||
366 | ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); | ||
367 | |||
368 | if (land.LandData.OwnerID == ownerID) | ||
369 | { | ||
370 | return; | ||
371 | } | ||
372 | } | ||
373 | |||
374 | //Only Estate Managers may use the function | ||
375 | if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("ESTATE_MANAGER")) | ||
376 | { | ||
377 | //Only Estate Managers may use the function | ||
378 | if (World.RegionInfo.EstateSettings.IsEstateManager(ownerID) && World.RegionInfo.EstateSettings.EstateOwner != ownerID) | ||
379 | { | ||
380 | return; | ||
381 | } | ||
382 | } | ||
383 | |||
384 | //Only regionowners may use the function | ||
385 | if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("ESTATE_OWNER")) | ||
386 | { | ||
387 | if (World.RegionInfo.EstateSettings.EstateOwner == ownerID) | ||
388 | { | ||
389 | return; | ||
390 | } | ||
391 | } | ||
392 | |||
338 | if (!m_FunctionPerms[function].AllowedCreators.Contains(ti.CreatorID)) | 393 | if (!m_FunctionPerms[function].AllowedCreators.Contains(ti.CreatorID)) |
339 | OSSLError( | 394 | OSSLError( |
340 | String.Format("{0} permission denied. Script creator is not in the list of users allowed to execute this function and prim owner also has no permission.", | 395 | String.Format("{0} permission denied. Script creator is not in the list of users allowed to execute this function and prim owner also has no permission.", |
341 | function)); | 396 | function)); |
342 | if (ti.CreatorID != ti.OwnerID) | 397 | if (ti.CreatorID != ownerID) |
343 | { | 398 | { |
344 | if ((ti.CurrentPermissions & (uint)PermissionMask.Modify) != 0) | 399 | if ((ti.CurrentPermissions & (uint)PermissionMask.Modify) != 0) |
345 | OSSLError( | 400 | OSSLError( |