private bool HasPersonalRelationship(ADUser adUser) { if (adUser == null) { return(false); } SharingPartnerIdentityCollection sharingPartnerIdentities = adUser.SharingPartnerIdentities; return(sharingPartnerIdentities != null && sharingPartnerIdentities.Contains(this.callerExternalIdentity.ExternalId.ToString())); }
public static bool HasSharingPartnership(Guid mailboxGuid, bool isArchive, string externalId, IRecipientSession recipientSession) { SharingPartnerIdentityCollection sharingPartnerIdentityCollection = DirectoryHelper.ReadSharingPartnerIdentities(mailboxGuid, isArchive, recipientSession); return(sharingPartnerIdentityCollection != null && sharingPartnerIdentityCollection.Count != 0 && sharingPartnerIdentityCollection.Contains(externalId)); }