diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Land/LandObject.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandObject.cs | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index 749bb3d..1e824bd 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs | |||
@@ -416,6 +416,37 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
416 | return false; | 416 | return false; |
417 | } | 417 | } |
418 | 418 | ||
419 | public bool HasGroupAccess(UUID avatar) | ||
420 | { | ||
421 | if (LandData.GroupID != UUID.Zero && (LandData.Flags & (uint)ParcelFlags.UseAccessGroup) == (uint)ParcelFlags.UseAccessGroup) | ||
422 | { | ||
423 | ScenePresence sp; | ||
424 | if (!m_scene.TryGetScenePresence(avatar, out sp)) | ||
425 | { | ||
426 | IGroupsModule groupsModule = m_scene.RequestModuleInterface<IGroupsModule>(); | ||
427 | if (groupsModule == null) | ||
428 | return false; | ||
429 | |||
430 | GroupMembershipData[] membership = groupsModule.GetMembershipData(avatar); | ||
431 | if (membership == null || membership.Length == 0) | ||
432 | return false; | ||
433 | |||
434 | foreach (GroupMembershipData d in membership) | ||
435 | { | ||
436 | if (d.GroupID == LandData.GroupID) | ||
437 | return true; | ||
438 | } | ||
439 | return false; | ||
440 | } | ||
441 | |||
442 | if (!sp.ControllingClient.IsGroupMember(LandData.GroupID)) | ||
443 | return false; | ||
444 | |||
445 | return true; | ||
446 | } | ||
447 | return false; | ||
448 | } | ||
449 | |||
419 | public bool IsBannedFromLand(UUID avatar) | 450 | public bool IsBannedFromLand(UUID avatar) |
420 | { | 451 | { |
421 | if (m_scene.Permissions.IsAdministrator(avatar)) | 452 | if (m_scene.Permissions.IsAdministrator(avatar)) |
@@ -452,9 +483,13 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
452 | return false; | 483 | return false; |
453 | }) == -1 && LandData.OwnerID != avatar) | 484 | }) == -1 && LandData.OwnerID != avatar) |
454 | { | 485 | { |
455 | return true; | 486 | if (!HasGroupAccess(avatar)) |
487 | { | ||
488 | return true; | ||
489 | } | ||
456 | } | 490 | } |
457 | } | 491 | } |
492 | |||
458 | return false; | 493 | return false; |
459 | } | 494 | } |
460 | 495 | ||