public static SecurityIdentifier MakeSidFromLocalDirctoryAddressBookEntryId(byte[] entryId) { if (!AddressBookEntryId.IsLocalDirctoryAddressBookEntryId(entryId)) { throw new InvalidParamException(new LocalizedString("Invalid local directory address book entry ID.")); } return new SecurityIdentifier(entryId, AddressBookEntryId.AddressBookEntryIdSize); }
public static bool TryGetUserFromEntryId(byte[] memberEntryId, StoreSession session, IRecipientSession recipientSession, LazilyInitialized <ExternalUserCollection> externalUsers, out string legacyDN, out SecurityIdentifier securityIdentifier, out List <SecurityIdentifier> sidHistory, out bool isGroup, out string displayName) { legacyDN = AclHelper.LegacyDnFromEntryId(memberEntryId); if (AddressBookEntryId.IsLocalDirctoryAddressBookEntryId(memberEntryId)) { sidHistory = null; return(AclHelper.ResolveLocalDirectoryUserFromAddressBookEntryId(memberEntryId, externalUsers, out securityIdentifier, out isGroup, out displayName)); } return(AclHelper.ResolveRecipientParametersFromLegacyDN(legacyDN, session, recipientSession, out securityIdentifier, out sidHistory, out isGroup, out displayName)); }
internal static string LegacyDnFromEntryId(byte[] entryId) { string result; Eidt eidt; if (entryId.Length == 0) { result = string.Empty; } else if (AddressBookEntryId.IsLocalDirctoryAddressBookEntryId(entryId)) { result = AddressBookEntryId.MakeLegacyDnFromLocalDirctoryAddressBookEntryId(entryId); eidt = Eidt.User; } else if (!AddressBookEntryId.IsAddressBookEntryId(entryId, out eidt, out result)) { throw new InvalidParamException(new LocalizedString("Invalid ABEID")); } return(result); }