Group based access restrictions to parcels require group membership, but not that this group is active for that user.

0.7.4.1
Snoopy Pfeffer 2012-04-05 10:25:54 +02:00
parent 600a86bcae
commit e4406c846d
1 changed files with 23 additions and 26 deletions

View File

@ -424,37 +424,34 @@ namespace OpenSim.Region.CoreModules.World.Land
{
if (LandData.GroupID != UUID.Zero && (LandData.Flags & (uint)ParcelFlags.UseAccessGroup) == (uint)ParcelFlags.UseAccessGroup)
{
ScenePresence sp;
if (!m_scene.TryGetScenePresence(avatar, out sp))
bool isMember;
if (m_groupMemberCache.TryGetValue(avatar, out isMember))
return isMember;
IGroupsModule groupsModule = m_scene.RequestModuleInterface<IGroupsModule>();
if (groupsModule == null)
{
bool isMember;
if (m_groupMemberCache.TryGetValue(avatar, out isMember))
return isMember;
IGroupsModule groupsModule = m_scene.RequestModuleInterface<IGroupsModule>();
if (groupsModule == null)
return false;
GroupMembershipData[] membership = groupsModule.GetMembershipData(avatar);
if (membership == null || membership.Length == 0)
{
m_groupMemberCache.Add(avatar, false, m_groupMemberCacheTimeout);
return false;
}
foreach (GroupMembershipData d in membership)
{
if (d.GroupID == LandData.GroupID)
{
m_groupMemberCache.Add(avatar, true, m_groupMemberCacheTimeout);
return true;
}
}
m_groupMemberCache.Add(avatar, false, m_groupMemberCacheTimeout);
return false;
}
return sp.ControllingClient.IsGroupMember(LandData.GroupID);
GroupMembershipData[] membership = groupsModule.GetMembershipData(avatar);
if (membership == null || membership.Length == 0)
{
m_groupMemberCache.Add(avatar, false, m_groupMemberCacheTimeout);
return false;
}
foreach (GroupMembershipData d in membership)
{
if (d.GroupID == LandData.GroupID)
{
m_groupMemberCache.Add(avatar, true, m_groupMemberCacheTimeout);
return true;
}
}
m_groupMemberCache.Add(avatar, false, m_groupMemberCacheTimeout);
return false;
}
return false;
}