diff options
author | Snoopy Pfeffer | 2012-04-05 10:25:54 +0200 |
---|---|---|
committer | Snoopy Pfeffer | 2012-04-05 10:25:54 +0200 |
commit | e4406c846d74212493890a46922292cd7fec2ea5 (patch) | |
tree | d47f5eeaf461297eaddc1c0e09309c5d196143e9 /OpenSim/Region/CoreModules/World | |
parent | Little bug fix in HasGroupAccess, to properly store the case "true" in the ca... (diff) | |
download | opensim-SC_OLD-e4406c846d74212493890a46922292cd7fec2ea5.zip opensim-SC_OLD-e4406c846d74212493890a46922292cd7fec2ea5.tar.gz opensim-SC_OLD-e4406c846d74212493890a46922292cd7fec2ea5.tar.bz2 opensim-SC_OLD-e4406c846d74212493890a46922292cd7fec2ea5.tar.xz |
Group based access restrictions to parcels require group membership, but not that this group is active for that user.
Diffstat (limited to 'OpenSim/Region/CoreModules/World')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandObject.cs | 47 |
1 files changed, 22 insertions, 25 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index ced7b52..a7c7cc5 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs | |||
@@ -424,37 +424,34 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
424 | { | 424 | { |
425 | if (LandData.GroupID != UUID.Zero && (LandData.Flags & (uint)ParcelFlags.UseAccessGroup) == (uint)ParcelFlags.UseAccessGroup) | 425 | if (LandData.GroupID != UUID.Zero && (LandData.Flags & (uint)ParcelFlags.UseAccessGroup) == (uint)ParcelFlags.UseAccessGroup) |
426 | { | 426 | { |
427 | ScenePresence sp; | 427 | bool isMember; |
428 | if (!m_scene.TryGetScenePresence(avatar, out sp)) | 428 | if (m_groupMemberCache.TryGetValue(avatar, out isMember)) |
429 | { | 429 | return isMember; |
430 | bool isMember; | ||
431 | if (m_groupMemberCache.TryGetValue(avatar, out isMember)) | ||
432 | return isMember; | ||
433 | |||
434 | IGroupsModule groupsModule = m_scene.RequestModuleInterface<IGroupsModule>(); | ||
435 | if (groupsModule == null) | ||
436 | return false; | ||
437 | 430 | ||
438 | GroupMembershipData[] membership = groupsModule.GetMembershipData(avatar); | 431 | IGroupsModule groupsModule = m_scene.RequestModuleInterface<IGroupsModule>(); |
439 | if (membership == null || membership.Length == 0) | 432 | if (groupsModule == null) |
440 | { | 433 | { |
441 | m_groupMemberCache.Add(avatar, false, m_groupMemberCacheTimeout); | 434 | m_groupMemberCache.Add(avatar, false, m_groupMemberCacheTimeout); |
442 | return false; | 435 | return false; |
443 | } | 436 | } |
444 | 437 | ||
445 | foreach (GroupMembershipData d in membership) | 438 | GroupMembershipData[] membership = groupsModule.GetMembershipData(avatar); |
446 | { | 439 | if (membership == null || membership.Length == 0) |
447 | if (d.GroupID == LandData.GroupID) | 440 | { |
448 | { | ||
449 | m_groupMemberCache.Add(avatar, true, m_groupMemberCacheTimeout); | ||
450 | return true; | ||
451 | } | ||
452 | } | ||
453 | m_groupMemberCache.Add(avatar, false, m_groupMemberCacheTimeout); | 441 | m_groupMemberCache.Add(avatar, false, m_groupMemberCacheTimeout); |
454 | return false; | 442 | return false; |
455 | } | 443 | } |
456 | 444 | ||
457 | return sp.ControllingClient.IsGroupMember(LandData.GroupID); | 445 | foreach (GroupMembershipData d in membership) |
446 | { | ||
447 | if (d.GroupID == LandData.GroupID) | ||
448 | { | ||
449 | m_groupMemberCache.Add(avatar, true, m_groupMemberCacheTimeout); | ||
450 | return true; | ||
451 | } | ||
452 | } | ||
453 | m_groupMemberCache.Add(avatar, false, m_groupMemberCacheTimeout); | ||
454 | return false; | ||
458 | } | 455 | } |
459 | return false; | 456 | return false; |
460 | } | 457 | } |