blob: 615a3dc85557730b9ae54ea72d91e91d84e954cd [file] [log] [blame]
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <set>
#include <string>
namespace chromeos {
typedef std::set<std::string> AffiliationIDSet;
// Returns true if there is at least one common element in two sets.
// Complexity: O(n + m), where n - size of the first set, m - size of
// the second set.
bool HaveCommonElement(const std::set<std::string>& set1,
const std::set<std::string>& set2);
// TODO(peletskyi): Remove email after affiliation based implementation will
// fully work.
// The function makes a decision if user with |user_affiliation_ids| and
// |email| is affiliated on the device with |device_affiliation_ids| and
// |enterprise_domain|.
bool IsUserAffiliated(const AffiliationIDSet& user_affiliation_ids,
const AffiliationIDSet& device_affiliation_ids,
const std::string& email);
} // namespace chromeos