protected override bool IsPostAdQueryAuthorized(UserResultMapping userResultMapping)
        {
            MServeQueryResult mserveQueryResult = userResultMapping.Result as MServeQueryResult;

            if (mserveQueryResult != null)
            {
                if (mserveQueryResult.RedirectServer == null)
                {
                    ExTraceGlobals.FrameworkTracer.TraceDebug <string>((long)this.GetHashCode(), "MServe provided NO redirect for '{0}'", userResultMapping.Mailbox);
                    return(false);
                }
                ExTraceGlobals.FrameworkTracer.TraceDebug <string, string>((long)this.GetHashCode(), "MServe provided redirect for '{0}' to {1}.", userResultMapping.Mailbox, mserveQueryResult.RedirectServer);
                return(true);
            }
            else
            {
                ADQueryResult adqueryResult = userResultMapping.Result as ADQueryResult;
                if (adqueryResult == null)
                {
                    return(false);
                }
                if (adqueryResult.Result.Data == null)
                {
                    return(false);
                }
                if (this.HasOrganizationRelationship(adqueryResult.Result.Data.OrganizationId))
                {
                    ExTraceGlobals.FrameworkTracer.TraceDebug <string>((long)this.GetHashCode(), "Organization relationship for '{0}'.", userResultMapping.Mailbox);
                    return(true);
                }
                if (this.HasPersonalRelationship(adqueryResult.Result.Data as ADUser))
                {
                    ExTraceGlobals.FrameworkTracer.TraceDebug <string>((long)this.GetHashCode(), "Personal relationship for '{0}'.", userResultMapping.Mailbox);
                    return(true);
                }
                ExTraceGlobals.FrameworkTracer.TraceDebug <string>((long)this.GetHashCode(), "No organization relationship for '{0}'.", userResultMapping.Mailbox);
                return(false);
            }
        }
Пример #2
0
        // Token: 0x06000360 RID: 864 RVA: 0x000157D0 File Offset: 0x000139D0
        protected override bool IsPostAdQueryAuthorized(UserResultMapping userResultMapping)
        {
            ADQueryResult adqueryResult = userResultMapping.Result as ADQueryResult;

            if (adqueryResult == null)
            {
                return(false);
            }
            if (adqueryResult.Result.Data == null)
            {
                ExTraceGlobals.FrameworkTracer.TraceDebug <string>((long)this.GetHashCode(), "ADQuery result is null for '{0}'.", userResultMapping.Mailbox);
                return(false);
            }
            OrganizationId organizationId = adqueryResult.Result.Data.OrganizationId;

            if (this.partnerUser.OrganizationId.Equals(organizationId))
            {
                ExTraceGlobals.FrameworkTracer.TraceDebug <string>((long)this.GetHashCode(), "ADQuery result for '{0}' matches the organization id.", userResultMapping.Mailbox);
                return(true);
            }
            ExTraceGlobals.FrameworkTracer.TraceDebug <string, OrganizationId, OrganizationId>((long)this.GetHashCode(), "ADQuery result for '{0}' is {1}, does not match the organization id {2}.", userResultMapping.Mailbox, organizationId, this.partnerUser.OrganizationId);
            return(false);
        }