// Token: 0x06001AD3 RID: 6867 RVA: 0x000708BC File Offset: 0x0006EABC
 private RestrictionCheckResult ShouldAcceptByDefault()
 {
     if (ADRecipientRestriction.IsNullOrEmptyCollection <ADObjectId>(this.acceptMessagesFrom) && ADRecipientRestriction.IsNullOrEmptyCollection <ADObjectId>(this.acceptMessagesFromDLMembers))
     {
         return(RestrictionCheckResult.AcceptedAcceptanceListEmpty);
     }
     return((RestrictionCheckResult)2147483654U);
 }
        // Token: 0x06001AD4 RID: 6868 RVA: 0x000708E0 File Offset: 0x0006EAE0
        private bool HasPermissionRestriction()
        {
            if (!this.isAdRecipient)
            {
                return(false);
            }
            bool flag = ADRecipientRestriction.IsNullOrEmptyCollection <ADObjectId>(this.acceptMessagesFrom) && ADRecipientRestriction.IsNullOrEmptyCollection <ADObjectId>(this.acceptMessagesFromDLMembers) && ADRecipientRestriction.IsNullOrEmptyCollection <ADObjectId>(this.rejectMessagesFrom) && ADRecipientRestriction.IsNullOrEmptyCollection <ADObjectId>(this.rejectMessagesFromDLMembers);

            return(!flag);
        }
示例#3
0
        // Token: 0x06001AB5 RID: 6837 RVA: 0x00070220 File Offset: 0x0006E420
        private bool IsAuthorized(ADRawEntry entry)
        {
            if (this.securityContext == null)
            {
                return(true);
            }
            RestrictionCheckResult restrictionCheckResult = ADRecipientRestriction.CheckDeliveryRestrictionForAuthenticatedSender(this.securityContext, entry, this.session);

            ExTraceGlobals.ADExpansionTracer.TraceDebug <ADObjectId, RestrictionCheckResult, object>((long)this.GetHashCode(), "Sender {0} permission is {1} for recipient {2}", this.securityContext, restrictionCheckResult, entry[ADObjectSchema.Id]);
            return(ADRecipientRestriction.Accepted(restrictionCheckResult));
        }
        // Token: 0x06001AD0 RID: 6864 RVA: 0x0007071C File Offset: 0x0006E91C
        private RestrictionCheckResult Check()
        {
            if (!this.CheckAuthentication())
            {
                return((RestrictionCheckResult)2147483655U);
            }
            RestrictionCheckResult restrictionCheckResult = this.CheckPermissionRestriction();

            if (this.moderationEnabled && ADRecipientRestriction.Accepted(restrictionCheckResult))
            {
                ADRecipientRestriction.tracer.TraceDebug <ADObjectId, RestrictionCheckResult>((long)this.GetHashCode(), "Sender {0} permission check result is {1}, with moderation enabled, now checking moderation bypasses", this.senderId, restrictionCheckResult);
                restrictionCheckResult = this.CheckModerationBypass();
            }
            ADRecipientRestriction.tracer.TraceDebug <ADObjectId, RestrictionCheckResult>((long)this.GetHashCode(), "Sender {0} permission check result is {1}", this.senderId, restrictionCheckResult);
            return(restrictionCheckResult);
        }
        // Token: 0x06001ACD RID: 6861 RVA: 0x000706CC File Offset: 0x0006E8CC
        public static RestrictionCheckResult CheckDeliveryRestriction(ADObjectId senderId, bool senderIsAuthenticated, ICollection <ADObjectId> rejectMessagesFrom, ICollection <ADObjectId> rejectMessagesFromDLMembers, ICollection <ADObjectId> acceptMessagesFrom, ICollection <ADObjectId> acceptMessagesFromDLMembers, ICollection <ADObjectId> bypassModerationFrom, ICollection <ADObjectId> bypassModerationFromDLMembers, ICollection <ADObjectId> moderators, ICollection <ADObjectId> managedBy, bool requiresAllSendersAreAuthenticated, bool moderationEnabled, RecipientType recipientType, IRecipientSession session, ISimpleCache <ADObjectId, bool> senderMembershipCache, int adQueryLimit)
        {
            ADRecipientRestriction adrecipientRestriction = new ADRecipientRestriction(senderId, true, senderIsAuthenticated, rejectMessagesFrom, rejectMessagesFromDLMembers, acceptMessagesFrom, acceptMessagesFromDLMembers, bypassModerationFrom, bypassModerationFromDLMembers, moderators, managedBy, requiresAllSendersAreAuthenticated, moderationEnabled, recipientType, session, senderMembershipCache, adQueryLimit);

            return(adrecipientRestriction.Check());
        }
 // Token: 0x06001ACB RID: 6859 RVA: 0x000705E4 File Offset: 0x0006E7E4
 public static RestrictionCheckResult CheckDeliveryRestrictionForAuthenticatedSender(ADObjectId senderId, ADRawEntry recipientEntry, IRecipientSession session)
 {
     return(ADRecipientRestriction.CheckDeliveryRestriction(senderId, true, (MultiValuedProperty <ADObjectId>)recipientEntry[ADRecipientSchema.RejectMessagesFrom], (MultiValuedProperty <ADObjectId>)recipientEntry[ADRecipientSchema.RejectMessagesFromDLMembers], (MultiValuedProperty <ADObjectId>)recipientEntry[ADRecipientSchema.AcceptMessagesOnlyFrom], (MultiValuedProperty <ADObjectId>)recipientEntry[ADRecipientSchema.AcceptMessagesOnlyFromDLMembers], (MultiValuedProperty <ADObjectId>)recipientEntry[ADRecipientSchema.BypassModerationFrom], (MultiValuedProperty <ADObjectId>)recipientEntry[ADRecipientSchema.BypassModerationFromDLMembers], (MultiValuedProperty <ADObjectId>)recipientEntry[ADRecipientSchema.ModeratedBy], (MultiValuedProperty <ADObjectId>)recipientEntry[ADGroupSchema.ManagedBy], true, (bool)recipientEntry[ADRecipientSchema.ModerationEnabled], (RecipientType)recipientEntry[ADRecipientSchema.RecipientType], session, null, -1));
 }