From 8b3b89ecf40ebe4e78ca77ccc5e14b2632829119 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 8 Jun 2010 20:31:39 +0100 Subject: backport xmlrpcgroups cache from master --- .../World/Permissions/PermissionsModule.cs | 23 +++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index a972ca6..53556ab 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs @@ -411,18 +411,23 @@ namespace OpenSim.Region.CoreModules.World.Permissions // with the powers requested (powers = 0 for no powers check) protected bool IsGroupMember(UUID groupID, UUID userID, ulong powers) { - if (null == m_groupsModule) - return false; - - GroupMembershipData gmd = m_groupsModule.GetMembershipData(groupID, userID); - - if (gmd != null) + //DateTime t1 = DateTime.Now; + bool result = false; + + if (null != m_groupsModule) { - if (((gmd.GroupPowers != 0) && powers == 0) || (gmd.GroupPowers & powers) == powers) - return true; + GroupMembershipData gmd = m_groupsModule.GetMembershipData(groupID, userID); + + if (gmd != null) + { + if (((gmd.GroupPowers != 0) && powers == 0) || (gmd.GroupPowers & powers) == powers) + result = true; + } } + + //m_log.DebugFormat("[PERMISSIONS]: Group member check took {0}", (DateTime.Now - t1).TotalMilliseconds); - return false; + return result; } /// -- cgit v1.1